diff --git a/jsonc/testdata/JSONTestSuite/test.ts b/jsonc/testdata/JSONTestSuite/test.ts index a430654f3955..5055581bbbde 100644 --- a/jsonc/testdata/JSONTestSuite/test.ts +++ b/jsonc/testdata/JSONTestSuite/test.ts @@ -18,7 +18,9 @@ function getError( // Make sure that the JSON.parse and JSONC.parse results match. for await ( - const dirEntry of walk(fromFileUrl(new URL("./", import.meta.url))) + const dirEntry of walk(fromFileUrl(new URL("./", import.meta.url)), { + exts: [".json"], + }) ) { if (!dirEntry.isFile) { continue; @@ -30,12 +32,12 @@ for await ( async fn() { const text = await Deno.readTextFile(dirEntry.path); - const [hasJsonError, jsonError, jsonResult] = getError(() => { - JSON.parse(text); - }); - const [hasJsoncError, jsoncError, jsoncResult] = getError(() => { - JSONC.parse(text); - }); + const [hasJsonError, jsonError, jsonResult] = getError(() => + JSON.parse(text) + ); + const [hasJsoncError, jsoncError, jsoncResult] = getError(() => + JSONC.parse(text) + ); // If an error occurs in JSON.parse() but no error occurs in JSONC.parse(), or vice versa, an error is thrown. if (hasJsonError !== hasJsoncError) {