File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -162,8 +162,19 @@ describe('esm', () => {
162162 } ) ;
163163
164164 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+
165176 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 ) ) ) } )` , {
167178 nodeIntegration : true ,
168179 sandbox : false ,
169180 contextIsolation : true
You can’t perform that action at this time.
0 commit comments