Skip to content

Commit 22183db

Browse files
committed
Tests
1 parent b2bed15 commit 22183db

File tree

2 files changed

+27
-11
lines changed

2 files changed

+27
-11
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"test:expect": "mocha --compilers js:babel-register --reporter spec test/expect/*.js",
99
"test:expectjs": "mocha --compilers js:babel-register --reporter spec test/expectjs/*.js",
1010
"test:should": "mocha --compilers js:babel-register --reporter spec test/should/*.js",
11-
"test": "npm run test:index && npm run test:chai && npm run test:expect && npm run test:expectjs && npm run test:should",
11+
"test:tape": "tape --require babel-register test/tape/*.js",
12+
"test": "npm run test:index && npm run test:chai && npm run test:expect && npm run test:expectjs && npm run test:should && npm run test:tape",
1213
"prepublish": "rimraf build && babel src --out-dir build --copy-files"
1314
},
1415
"repository": {

test/tape/index.js

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,32 @@
1-
import tape from 'tape'
1+
import test from 'tape';
22
import thunk from 'redux-thunk';
33

4-
import { registerMiddlewares } from '../../src';
5-
import { registerAssertions } from '../../src/should';
4+
import { assertions, registerMiddlewares } from '../../src';
65
import actions from '../testingData/actions';
76

87
registerMiddlewares([thunk]);
9-
registerAssertions();
108

11-
describe('tape', () => {
12-
describe('', () => {
13-
it('', (done) => {
14-
done()
15-
})
16-
});
9+
test('tape', t => {
10+
t.plan(1);
11+
const msg = 'should pass with t.plan';
12+
13+
assertions.toDispatchActionsWithState(
14+
{ property: 'value' },
15+
actions.actionCreatorWithGetState(),
16+
actions.actionWithGetState({ property: 'value' }),
17+
t.pass.bind(this, msg),
18+
t.fail.bind(this, msg)
19+
);
20+
});
21+
22+
test('tape', t => {
23+
const msg = 'should pass with t.end';
24+
25+
assertions.toDispatchActionsWithState(
26+
{ property: 'value' },
27+
actions.actionCreatorWithGetState(),
28+
actions.actionWithGetState({ property: 'value' }),
29+
t.pass.bind(this, msg),
30+
t.fail.bind(this, msg)
31+
).then(t.end);
1732
});

0 commit comments

Comments
 (0)