Files
test-repo/tests/format/json/json-test-suite/format.test.js
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
721 B
JavaScript
Raw Normal View History

2025-12-02 16:33:39 +08:00
import { parsing, transform } from "json-test-suite";
const SKIP = new Set([
2026-06-16 02:09:45 +08:00
// Prettier doesn't support other encodings than UTF-8
2025-12-02 16:33:39 +08:00
"i_string_utf16BE_no_BOM.json",
"i_string_utf16LE_no_BOM.json",
"i_string_UTF-16LE_with_BOM.json",
// RangeError: Maximum call stack size exceeded
"i_structure_500_nested_arrays.json",
]);
const cases = [...parsing, ...transform]
.map(({ name, input, error }) => {
if (error || SKIP.has(name)) {
2025-12-02 16:33:39 +08:00
return;
}
return {
name,
code: input,
};
})
.filter(Boolean);
for (const parser of ["json", "jsonc", "json5", "json-stringify"]) {
runFormatTest(
{
importMeta: import.meta,
snippets: cases,
},
[parser],
);
}