Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1728203
commit caa5897
Showing
9 changed files
with
159 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
'use strict'; | ||
Check failure on line 1 in test/es-module/test-import-jsonc.js GitHub Actions / test-macOS
|
||
|
||
const common = require('../common'); | ||
const assert = require('assert'); | ||
|
||
const jsonFiles = [ | ||
// [file, [throwWithTypeJSON, throwWithTypeJSONC]] | ||
['../fixtures/es-modules/json-with-comments/regular.json', [false, false]], | ||
['../fixtures/es-modules/json-with-comments/comments.json', [true, false]], | ||
['../fixtures/es-modules/json-with-comments/comments.jsonc', [true, false]], | ||
]; | ||
|
||
for (const [file, [throwWithTypeJSON, throwWithTypeJSONC]] of jsonFiles) { | ||
|
||
assert[throwWithTypeJSON ? 'rejects' : 'doesNotReject'](async () => { | ||
await import(file, { with: { type: 'json' } }); | ||
}); | ||
|
||
assert[throwWithTypeJSONC ? 'rejects' : 'doesNotReject'](async () => { | ||
await import(file, { with: { type: 'jsonc' } }); | ||
}); | ||
} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"key": "value" | ||
// Some comment | ||
/* Also | ||
a comment */ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"key": "value" | ||
// Some comment | ||
/* Also | ||
a comment */ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"key": "value" | ||
} |