@@ -31,25 +31,25 @@ describe('link_node_modules', () => {
31
31
mkdirp ( workspace ) ;
32
32
} ) ;
33
33
34
- it ( 'should report when modules manifest absent' , ( ) => {
34
+ it ( 'should report when modules manifest absent' , async ( ) => {
35
35
try {
36
- ( linker as any ) . main ( ) ;
36
+ await ( linker as any ) . main ( ) ;
37
37
} catch ( expected ) {
38
38
expect ( expected . message ) . toContain ( 'requires one argument' ) ;
39
39
}
40
40
try {
41
- ( linker as any ) . main ( [ ] ) ;
41
+ await ( linker as any ) . main ( [ ] ) ;
42
42
} catch ( expected ) {
43
43
expect ( expected . message ) . toContain ( 'requires one argument' ) ;
44
44
}
45
45
try {
46
- ( linker as any ) . main ( [ 'bad_path' ] ) ;
46
+ await ( linker as any ) . main ( [ 'bad_path' ] ) ;
47
47
} catch ( expected ) {
48
48
expect ( expected . message ) . toContain ( 'ENOENT' ) ;
49
49
}
50
50
} ) ;
51
51
52
- it ( 'should handle first-party packages in workspace' , ( ) => {
52
+ it ( 'should handle first-party packages in workspace' , async ( ) => {
53
53
// Set the cwd() like Bazel would in the execroot
54
54
process . chdir ( workspace ) ;
55
55
@@ -62,15 +62,15 @@ describe('link_node_modules', () => {
62
62
'workspace' : workspace ,
63
63
} ) ;
64
64
65
- linker . main ( [ 'manifest.json' ] , { dir : process . env [ 'RUNFILES_DIR' ] } as any ) ;
65
+ await linker . main ( [ 'manifest.json' ] , { dir : process . env [ 'RUNFILES_DIR' ] } as any ) ;
66
66
67
67
// The linker expects to run as its own process, so it changes the wd
68
68
process . chdir ( path . join ( ) ) ;
69
69
expect ( fs . readdirSync ( path . join ( process . env [ 'TEST_TMPDIR' ] ! , workspace , 'node_modules' , 'a' ) ) )
70
70
. toContain ( 'index.js' ) ;
71
71
} ) ;
72
72
73
- it ( 'should handle third-party packages in runfiles' , ( ) => {
73
+ it ( 'should handle third-party packages in runfiles' , async ( ) => {
74
74
mkdirp ( 'npm/node_modules/some-package' ) ;
75
75
const idx = 'npm/node_modules/some-package/index.js' ;
76
76
fs . writeFileSync ( idx , 'exports = {}' , 'utf-8' ) ;
@@ -82,7 +82,7 @@ describe('link_node_modules', () => {
82
82
writeManifest ( { 'root' : 'npm/node_modules' } ) ;
83
83
writeRunfiles ( runfilesManifest ) ;
84
84
85
- linker . main ( [ 'manifest.json' ] , new linker . Runfiles ( ) ) ;
85
+ await linker . main ( [ 'manifest.json' ] , new linker . Runfiles ( ) ) ;
86
86
87
87
// The linker expects to run as its own process, so it changes the wd
88
88
process . chdir ( path . join ( process . env [ 'TEST_TMPDIR' ] ! , workspace ) ) ;
0 commit comments