Skip to content

Commit 137afd2

Browse files
test(test262): let a fixture's circular reexport warn without failing
Every test compiles with a context dependency over `*_FIXTURE.js`, so the circular fixtures beside a test are bundled into it whether it imports them or not. The new circular-reexport warning then fired on 136 cases that have nothing to do with circular reexports, because the harness fails a test on any warning at all. Only that warning, and only when it names a fixture, is now let through.
1 parent 3454c13 commit 137afd2

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

‎test/test262.spectest.js‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,16 +1301,28 @@ describe("test262", () => {
13011301
);
13021302
}
13031303

1304+
// The `_FIXTURE` context dependency bundles every fixture beside
1305+
// the test, so a circular reexport in one warns on tests that
1306+
// never import it.
1307+
const unexpectedWarnings = warnings.filter(
1308+
(item) =>
1309+
!/is part of a circular reexport chain in '\.\/[^']*_FIXTURE\.js'/.test(
1310+
item.message
1311+
)
1312+
);
1313+
13041314
if (
1305-
warnings.length > 0 &&
1315+
unexpectedWarnings.length > 0 &&
13061316
// Just syntax test
13071317
name !==
13081318
"module-code/top-level-await/syntax/await-expr-dyn-import.js"
13091319
) {
13101320
throw new Error(
13111321
`Warnings in test file "${outputFile}" ("${testFile}")`,
13121322
{
1313-
cause: new Error(`Errors:\n\n${warnings.join("\n")}`)
1323+
cause: new Error(
1324+
`Errors:\n\n${unexpectedWarnings.join("\n")}`
1325+
)
13141326
}
13151327
);
13161328
}

0 commit comments

Comments
 (0)