File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -162,8 +162,19 @@ describe('esm', () => {
162
162
} ) ;
163
163
164
164
describe ( 'with context isolation' , ( ) => {
165
+ let badFilePath = '' ;
166
+
167
+ beforeEach ( async ( ) => {
168
+ badFilePath = path . resolve ( path . resolve ( os . tmpdir ( ) , 'bad-file.badjs' ) ) ;
169
+ await fs . promises . writeFile ( badFilePath , 'const foo = "bar";' ) ;
170
+ } ) ;
171
+
172
+ afterEach ( async ( ) => {
173
+ await fs . promises . unlink ( badFilePath ) ;
174
+ } ) ;
175
+
165
176
it ( 'should use nodes esm dynamic loader in the isolated context' , async ( ) => {
166
- const [ , preloadError ] = await loadWindowWithPreload ( `await import(${ JSON . stringify ( hostsUrl ) } )` , {
177
+ const [ , preloadError ] = await loadWindowWithPreload ( `await import(${ JSON . stringify ( ( pathToFileURL ( badFilePath ) ) ) } )` , {
167
178
nodeIntegration : true ,
168
179
sandbox : false ,
169
180
contextIsolation : true
You can’t perform that action at this time.
0 commit comments