Skip to content
This repository was archived by the owner on Aug 7, 2023. It is now read-only.

Commit ec9c4ef

Browse files
test: fix setTimeout in testing environment
The test runner wraps `setTimeout` and `setInterval`, figuring that you'll advance time manually, but that's not what our tests expect. Luckily, it can be turned off.
1 parent 5d8f726 commit ec9c4ef

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

spec/node-path-tester-spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
'use babel';
2+
/* global pass */
23

34
import NodePathTester from '../lib/node-path-tester';
45

@@ -26,10 +27,9 @@ describe('Node path tester', () => {
2627
expect(await NodePathTester.test('node')).not.toBe(false);
2728
try {
2829
await NodePathTester.test('fdsfljksdafd');
29-
// If we get this far, fail the test
30-
expect(false).toBe(true);
30+
fail();
3131
} catch (err) {
32-
expect(err instanceof Error).toBe(true);
32+
pass();
3333
}
3434
});
3535
});

spec/runner.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,21 @@ function setDefaultSettings(namespace, settings) {
1616
module.exports = createRunner({
1717
testPackages: ['linter', 'linter-ui-default'],
1818
timeReporter: true,
19-
specHelper: true
19+
specHelper: {
20+
atom: true,
21+
attachToDom: true,
22+
ci: true,
23+
customMatchers: true,
24+
jasmineFocused: true,
25+
jasmineJson: true,
26+
jasminePass: true,
27+
jasmineTagged: true,
28+
mockClock: true,
29+
mockLocalStorage: true,
30+
profile: true,
31+
set: true,
32+
unspy: true
33+
}
2034
},
2135
() => {
2236
beforeEach(() => {

0 commit comments

Comments
 (0)