|
1 | | -import tape from 'tape' |
| 1 | +import test from 'tape'; |
2 | 2 | import thunk from 'redux-thunk'; |
3 | 3 |
|
4 | | -import { registerMiddlewares } from '../../src'; |
5 | | -import { registerAssertions } from '../../src/should'; |
| 4 | +import { assertions, registerMiddlewares } from '../../src'; |
6 | 5 | import actions from '../testingData/actions'; |
7 | 6 |
|
8 | 7 | registerMiddlewares([thunk]); |
9 | | -registerAssertions(); |
10 | 8 |
|
11 | 9 | describe('tape', () => { |
12 | | - describe('', () => { |
13 | | - it('', (done) => { |
14 | | - done() |
15 | | - }) |
| 10 | + describe('t.plan', () => { |
| 11 | + it('should finish the test without hanging', (done) => { |
| 12 | + test('tape test', t => { |
| 13 | + t.plan(1); |
| 14 | + |
| 15 | + assertions.toDispatchActionsWithState( |
| 16 | + { property: 'value' }, |
| 17 | + actions.actionCreatorWithGetState(), |
| 18 | + actions.actionWithGetState({ property: 'value' }), |
| 19 | + () => { |
| 20 | + t.pass(); |
| 21 | + done(); |
| 22 | + }, |
| 23 | + t.fail |
| 24 | + ); |
| 25 | + }); |
| 26 | + }); |
| 27 | + }); |
| 28 | + |
| 29 | + describe('t.plan', () => { |
| 30 | + it('should finish the test without hanging', (done) => { |
| 31 | + test('tape test', t => { |
| 32 | + t.plan(1); |
| 33 | + |
| 34 | + assertions.toDispatchActionsWithState( |
| 35 | + { property: 'value' }, |
| 36 | + actions.actionCreatorWithGetState(), |
| 37 | + actions.actionWithGetState({ property: 'value' }), |
| 38 | + t.pass, |
| 39 | + t.fail |
| 40 | + ).then(done); |
| 41 | + }); |
| 42 | + }); |
| 43 | + }); |
| 44 | + |
| 45 | + describe('t.end', () => { |
| 46 | + it('should finish the test without hanging', (done) => { |
| 47 | + test('tape test', t => { |
| 48 | + assertions.toDispatchActionsWithState( |
| 49 | + { property: 'value' }, |
| 50 | + actions.actionCreatorWithGetState(), |
| 51 | + actions.actionWithGetState({ property: 'value' }), |
| 52 | + () => { |
| 53 | + t.pass(); |
| 54 | + t.end(); |
| 55 | + done(); |
| 56 | + }, |
| 57 | + t.fail |
| 58 | + ); |
| 59 | + }); |
| 60 | + }); |
16 | 61 | }); |
17 | 62 | }); |
0 commit comments