This repository was archived by the owner on Aug 7, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change
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
+ } ) ;
You can’t perform that action at this time.
0 commit comments