Add script to ensure format test directories contains format test script (#17077)

This commit is contained in:
fisker Cheung authored and GitHub committed 2025-02-08 17:27:43 +08:00
1 parent 52aee0254b
commit 5b3dd6a6ef
7 files changed
+67 -7

No files matched your search

+1 -3
View File
@@ -142,11 +142,9 @@ function runFormatTest(fixtures, parsers, options) {
? fixtures
: { importMeta: fixtures };
// TODO: Remove this in 2025
// Prevent the old files `jsfmt.spec.js` get merged by accident
const filename = path.basename(new URL(importMeta.url).pathname);
if (filename !== "format.test.js") {
throw new Error(`'${filename}' has been renamed as 'format.test.js'.`);
throw new Error(`Format test should run in file named 'format.test.js'.`);
}
const dirname = path.dirname(url.fileURLToPath(importMeta.url));