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

Commit 23f2baa

Browse files
test: add node-path-tester-spec.js
1 parent 6305f02 commit 23f2baa

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

spec/node-path-tester-spec.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
'use babel';
2+
3+
import NodePathTester from '../lib/node-path-tester';
4+
5+
describe('Node path tester', () => {
6+
7+
beforeEach(async () => {
8+
atom.config.set('linter-eslint-node.nodeBin', 'node');
9+
10+
atom.packages.triggerDeferredActivationHooks();
11+
atom.packages.triggerActivationHook('core:loaded-shell-environment');
12+
13+
await atom.packages.activatePackage('language-javascript');
14+
await atom.packages.activatePackage('linter-eslint-node');
15+
});
16+
17+
describe('testSync', () => {
18+
it('tests the location of nodeBin synchronously', () => {
19+
expect(NodePathTester.testSync('node')).not.toBe(false);
20+
expect(NodePathTester.testSync('fdsfljksdafd')).toBe(false);
21+
});
22+
});
23+
24+
describe('test', () => {
25+
it('tests the location of nodeBin asynchronously', async () => {
26+
expect(await NodePathTester.test('node')).not.toBe(false);
27+
try {
28+
await NodePathTester.test('fdsfljksdafd');
29+
// If we get this far, fail the test
30+
expect(false).toBe(true);
31+
} catch (err) {
32+
expect(err instanceof Error).toBe(true);
33+
}
34+
});
35+
});
36+
});

0 commit comments

Comments
 (0)