Skip to content

Commit dbb4119

Browse files
committed
Add tests with setImmediate.
1 parent accdde5 commit dbb4119

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

.travis.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ branches:
1515
script:
1616
# Test code
1717
- npm run lint
18-
- npm test
18+
- npm run build
19+
- npm run test:microtask
20+
- if [ "$TRAVIS_NODE_VERSION" != "10" ]; then
21+
npm run test:immediate;
22+
fi
1923
# Test documentation
2024
- npm run docs
2125
# Test packaging

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
"build:commonjs": "tsc --module commonjs && mv asynciterator.js asynciterator.cjs",
2424
"build:types": "tsc -d && rm asynciterator.js",
2525
"prepare": "npm run build",
26-
"test": "npm run build:module && npm run mocha",
26+
"test": "npm run build:module && npm run test:microtask",
27+
"test:microtask": "npm run mocha",
28+
"test:immediate": "npm run mocha -- --require test/useSetImmediate.js",
2729
"mocha": "c8 mocha",
2830
"lint": "eslint asynciterator.ts test",
2931
"docs": "npm run build:module && npm run jsdoc",

test/useSetImmediate.js

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import { setTaskScheduler } from '../asynciterator.mjs';
2+
setTaskScheduler(setImmediate);

0 commit comments

Comments
 (0)