File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
tests/esm-import-assertions Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -78,14 +78,14 @@ if (nodeSupportsImportAssertions) {
7878 test . suite ( 'Supports import assertions' , ( test ) => {
7979 test ( 'Can import JSON using the appropriate flag and assertion' , async ( t ) => {
8080 const { err, stdout } = await exec (
81- `${ CMD_ESM_LOADER_WITHOUT_PROJECT } ./importJson.ts` ,
81+ `${ CMD_ESM_LOADER_WITHOUT_PROJECT } --experimental-json-modules ./importJson.ts` ,
8282 {
8383 cwd : resolve ( TEST_DIR , 'esm-import-assertions' ) ,
8484 }
8585 ) ;
8686 expect ( err ) . toBe ( null ) ;
87- expect ( stdout ) . toMatch (
88- 'A fuchsia car has 2 seats and the doors are open.` \nDone!'
87+ expect ( stdout . trim ( ) ) . toBe (
88+ 'A fuchsia car has 2 seats and the doors are open.\nDone!'
8989 ) ;
9090 } ) ;
9191 } ) ;
Original file line number Diff line number Diff line change @@ -18,8 +18,8 @@ await import('./car.json').then(
1818 ( ) => {
1919 throw new Error ( 'should have thrown' ) ;
2020 } ,
21- ( error : Error ) => {
22- if ( ! error . message . includes ( 'foo bar' ) ) {
21+ ( error : any ) => {
22+ if ( error . code !== 'ERR_IMPORT_ASSERTION_TYPE_MISSING' ) {
2323 throw error ;
2424 }
2525 /* error is expected */
You can’t perform that action at this time.
0 commit comments