Skip to content

Commit b80c336

Browse files
committed
Tests with issues
1 parent b2bed15 commit b80c336

File tree

2 files changed

+55
-9
lines changed

2 files changed

+55
-9
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": "mocha --compilers js:babel-register --reporter spec 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: 53 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,62 @@
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

119
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+
});
1661
});
1762
});

0 commit comments

Comments
 (0)