File tree 2 files changed +5
-5
lines changed
tests/esm-import-assertions
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -78,14 +78,14 @@ if (nodeSupportsImportAssertions) {
78
78
test . suite ( 'Supports import assertions' , ( test ) => {
79
79
test ( 'Can import JSON using the appropriate flag and assertion' , async ( t ) => {
80
80
const { err, stdout } = await exec (
81
- `${ CMD_ESM_LOADER_WITHOUT_PROJECT } ./importJson.ts` ,
81
+ `${ CMD_ESM_LOADER_WITHOUT_PROJECT } --experimental-json-modules ./importJson.ts` ,
82
82
{
83
83
cwd : resolve ( TEST_DIR , 'esm-import-assertions' ) ,
84
84
}
85
85
) ;
86
86
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!'
89
89
) ;
90
90
} ) ;
91
91
} ) ;
Original file line number Diff line number Diff line change @@ -18,8 +18,8 @@ await import('./car.json').then(
18
18
( ) => {
19
19
throw new Error ( 'should have thrown' ) ;
20
20
} ,
21
- ( error : Error ) => {
22
- if ( ! error . message . includes ( 'foo bar' ) ) {
21
+ ( error : any ) => {
22
+ if ( error . code !== 'ERR_IMPORT_ASSERTION_TYPE_MISSING' ) {
23
23
throw error ;
24
24
}
25
25
/* error is expected */
You can’t perform that action at this time.
0 commit comments