Cleanup failed tests (#19749)

This commit is contained in:
fisker Cheung authored and GitHub committed 2026-07-29 22:39:32 +08:00
1 parent 9df49a5516
commit fd56f7a52a
23 files changed
+210 -48

No files matched your search

@@ -51,48 +51,16 @@ const commentClosureTypecaseTests = [
const disabledTests = new Map(
Object.entries({
espree: [
...commentClosureTypecaseTests,
"js/explicit-resource-management/valid-await-using-asi-assignment.js",
],
acorn: [
"js/explicit-resource-management/valid-await-using-asi-assignment.js",
],
espree: commentClosureTypecaseTests,
acorn: [],
meriyah: [],
"babel-ts": [
"typescript/conformance/types/moduleDeclaration/kind-detection.ts",
// https://github.com/babel/babel/pull/17659
"typescript/conformance/internalModules/importDeclarations/circularImportAlias.ts",
"typescript/conformance/internalModules/importDeclarations/exportImportAlias.ts",
"typescript/conformance/internalModules/importDeclarations/importAliasIdentifiers.ts",
"typescript/conformance/internalModules/importDeclarations/shadowedInternalModule.ts",
"typescript/conformance/types/moduleDeclaration/moduleDeclaration.ts",
"typescript/conformance/types/ambient/ambientDeclarations.ts",
"typescript/compiler/declareDottedModuleName.ts",
"typescript/compiler/privacyGloImport.ts",
"typescript/declare/declare_module.ts",
"typescript/const/initializer-ambient-context.ts",
"typescript/keywords/keywords.ts",
"typescript/keywords/module.ts",
"typescript/module/global.ts",
"typescript/module/keyword.ts",
"typescript/module/module_nested.ts",
"typescript/custom/stability/moduleBlock.ts",
"typescript/interface2/module.ts",
],
"babel-ts": [],
oxc: [],
"oxc-ts": [],
yuku: ["js/await/await-with-parens.js"],
"yuku-ts": ["js/await/await-with-parens.js"],
hermes: [
...commentClosureTypecaseTests,
// Not supported
"flow/comments/",
"flow/flow-repo/union_new/",
// Different result
"flow/hook/comments-before-arrow.js",
"js/await/like-call.js",
],
flow: [
@@ -315,6 +315,17 @@ module T.U {
================================================================================
`;
exports[`declareDottedModuleName.ts format[babel-ts] 1`] = `
"\`module ... {}\` declarations must have a string name. Use \`namespace ... {}\` instead. (2:1)
1 | // @declaration: true
> 2 | module M {
| ^
3 | module P.Q { } // This shouldnt be emitted
4 | }
5 |
Cause: \`module ... {}\` declarations must have a string name. Use \`namespace ... {}\` instead. (2:0)"
`;
exports[`decrementAndIncrementOperators.ts format 1`] = `
====================================options=====================================
parsers: ["typescript"]
@@ -870,3 +881,14 @@ module m2 {
================================================================================
`;
exports[`privacyGloImport.ts format[babel-ts] 1`] = `
"\`module ... {}\` declarations must have a string name. Use \`namespace ... {}\` instead. (2:1)
1 | //@declaration: true
> 2 | module m1 {
| ^
3 | export module m1_M1_public {
4 | export class c1 {
5 | }
Cause: \`module ... {}\` declarations must have a string name. Use \`namespace ... {}\` instead. (2:0)"
`;
@@ -1 +1,3 @@
runFormatTest(import.meta, ["typescript"]);
runFormatTest(import.meta, ["typescript"], {
errors: { "babel-ts": ["declareDottedModuleName.ts", "privacyGloImport.ts"] },
});
@@ -47,6 +47,18 @@ var c = new B.a.C();
================================================================================
`;
exports[`circularImportAlias.ts format[babel-ts] 1`] = `
"\`module ... {}\` declarations must have a string name. Use \`namespace ... {}\` instead. (3:1)
1 | // expected no error
2 |
> 3 | module B {
| ^
4 | export import a = A;
5 | export class D extends a.C {
6 | id: number;
Cause: \`module ... {}\` declarations must have a string name. Use \`namespace ... {}\` instead. (3:0)"
`;
exports[`exportImportAlias.ts format 1`] = `
====================================options=====================================
parsers: ["typescript"]
@@ -197,6 +209,18 @@ var p: M.D.Point;
================================================================================
`;
exports[`exportImportAlias.ts format[babel-ts] 1`] = `
"\`module ... {}\` declarations must have a string name. Use \`namespace ... {}\` instead. (3:1)
1 | // expect no errors here
2 |
> 3 | module A {
| ^
4 |
5 | export var x = 'hello world'
6 | export class Point {
Cause: \`module ... {}\` declarations must have a string name. Use \`namespace ... {}\` instead. (3:0)"
`;
exports[`exportInterface.ts format 1`] = `
====================================options=====================================
parsers: ["typescript"]
@@ -315,6 +339,16 @@ var p: { x: number; y: number };
================================================================================
`;
exports[`importAliasIdentifiers.ts format[babel-ts] 1`] = `
"\`module ... {}\` declarations must have a string name. Use \`namespace ... {}\` instead. (1:1)
> 1 | module moduleA {
| ^
2 | export class Point {
3 | constructor(public x: number, public y: number) { }
4 | }
Cause: \`module ... {}\` declarations must have a string name. Use \`namespace ... {}\` instead. (1:0)"
`;
exports[`invalidImportAliasIdentifiers.ts format 1`] = `
====================================options=====================================
parsers: ["typescript"]
@@ -448,3 +482,15 @@ module Z {
================================================================================
`;
exports[`shadowedInternalModule.ts format[babel-ts] 1`] = `
"\`module ... {}\` declarations must have a string name. Use \`namespace ... {}\` instead. (3:1)
1 | // all errors imported modules conflict with local variables
2 |
> 3 | module A {
| ^
4 | export var Point = { x: 0, y: 0 }
5 | export interface Point {
6 | x: number;
Cause: \`module ... {}\` declarations must have a string name. Use \`namespace ... {}\` instead. (3:0)"
`;
@@ -1 +1,10 @@
runFormatTest(import.meta, ["typescript"]);
runFormatTest(import.meta, ["typescript"], {
errors: {
"babel-ts": [
"circularImportAlias.ts",
"exportImportAlias.ts",
"importAliasIdentifiers.ts",
"shadowedInternalModule.ts",
],
},
});
@@ -30,3 +30,15 @@ declare namespace f {}
================================================================================
`;
exports[`ambientDeclarations.ts format[babel-ts] 1`] = `
"\`module ... {}\` declarations must have a string name. Use \`namespace ... {}\` instead. (8:16)
6 | declare interface c {}
7 | declare class d {}
> 8 | declare module e {}
| ^
9 | declare module "g" {}
10 | declare namespace f {}
11 |
Cause: \`module ... {}\` declarations must have a string name. Use \`namespace ... {}\` instead. (8:15)"
`;
@@ -1 +1,3 @@
runFormatTest(import.meta, ["typescript"]);
runFormatTest(import.meta, ["typescript"], {
errors: { "babel-ts": ["ambientDeclarations.ts"] },
});
@@ -39,3 +39,13 @@ declare module "B" {
================================================================================
`;
exports[`moduleDeclaration.ts format[babel-ts] 1`] = `
"\`module ... {}\` declarations must have a string name. Use \`namespace ... {}\` instead. (1:1)
> 1 | module A {
| ^
2 | export class A {
3 | }
4 | }
Cause: \`module ... {}\` declarations must have a string name. Use \`namespace ... {}\` instead. (1:0)"
`;
@@ -1 +1,3 @@
runFormatTest(import.meta, ["typescript"]);
runFormatTest(import.meta, ["typescript"], {
errors: { "babel-ts": ["moduleDeclaration.ts"] },
});
@@ -40,3 +40,13 @@ declare module N {
================================================================================
`;
exports[`initializer-ambient-context.ts format[babel-ts] 1`] = `
"\`module ... {}\` declarations must have a string name. Use \`namespace ... {}\` instead. (1:16)
> 1 | declare module N {
| ^
2 | enum E {
3 | ok = 0
4 | }
Cause: \`module ... {}\` declarations must have a string name. Use \`namespace ... {}\` instead. (1:15)"
`;
+3 -1
View File
@@ -1 +1,3 @@
runFormatTest(import.meta, ["typescript"]);
runFormatTest(import.meta, ["typescript"], {
errors: { "babel-ts": ["initializer-ambient-context.ts"] },
});
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`moduleBlock.ts format 1`] = `
exports[`module-block.ts format 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80 (default) |
@@ -53,3 +53,13 @@ module m2 {
================================================================================
`;
exports[`module-block.ts format[babel-ts] 1`] = `
"\`module ... {}\` declarations must have a string name. Use \`namespace ... {}\` instead. (1:1)
> 1 | module m2 {
| ^
2 | function fn() {
3 | return 1;
4 | }
Cause: \`module ... {}\` declarations must have a string name. Use \`namespace ... {}\` instead. (1:0)"
`;
@@ -1 +1,3 @@
runFormatTest(import.meta, ["typescript"]);
runFormatTest(import.meta, ["typescript"], {
errors: { "babel-ts": ["module-block.ts"] },
});
@@ -118,6 +118,16 @@ declare module X {
================================================================================
`;
exports[`module.ts - {"trailingComma":"es5"} format[babel-ts] 1`] = `
"\`module ... {}\` declarations must have a string name. Use \`namespace ... {}\` instead. (1:16)
> 1 | declare module X {
| ^
2 | declare interface Y { x: number; }
3 | }
4 |
Cause: \`module ... {}\` declarations must have a string name. Use \`namespace ... {}\` instead. (1:15)"
`;
exports[`module.ts - {"trailingComma":"es5"} format[oxc-ts] 1`] = `
"A 'declare' modifier cannot be used in an already ambient context. (2:3)
1 | declare module X {
@@ -1,4 +1,4 @@
runFormatTest(import.meta, ["typescript", "flow"], {
trailingComma: "es5",
errors: { "oxc-ts": ["module.ts"] },
errors: { "oxc-ts": ["module.ts"], "babel-ts": ["module.ts"] },
});
@@ -70,6 +70,16 @@ module YYY4 {
================================================================================
`;
exports[`keywords.ts format[babel-ts] 1`] = `
"\`module ... {}\` declarations must have a string name. Use \`namespace ... {}\` instead. (1:1)
> 1 | module Y4 {
| ^
2 | enum Color { Blue, Red }
3 | }
4 |
Cause: \`module ... {}\` declarations must have a string name. Use \`namespace ... {}\` instead. (1:0)"
`;
exports[`keywords-2.ts format 1`] = `
====================================options=====================================
parsers: ["typescript"]
@@ -170,3 +180,13 @@ module Y3 {
================================================================================
`;
exports[`module.ts format[babel-ts] 1`] = `
"\`module ... {}\` declarations must have a string name. Use \`namespace ... {}\` instead. (1:1)
> 1 | module Y3 {
| ^
2 | module Module {
3 | class A { s: string }
4 | }
Cause: \`module ... {}\` declarations must have a string name. Use \`namespace ... {}\` instead. (1:0)"
`;
@@ -1 +1,3 @@
runFormatTest(import.meta, ["typescript"]);
runFormatTest(import.meta, ["typescript"], {
errors: { "babel-ts": ["keywords.ts", "module.ts"] },
});
@@ -40,6 +40,17 @@ declare namespace global {}
================================================================================
`;
exports[`global.ts format[babel-ts] 1`] = `
"\`module ... {}\` declarations must have a string name. Use \`namespace ... {}\` instead. (2:1)
1 | namespace global {}
> 2 | module global {}
| ^
3 | global {}
4 | declare global {}
5 | declare /* module */ global {}
Cause: \`module ... {}\` declarations must have a string name. Use \`namespace ... {}\` instead. (2:0)"
`;
exports[`keyword.ts format 1`] = `
====================================options=====================================
parsers: ["typescript"]
@@ -121,7 +132,17 @@ module /* namespace */ "x" {}
================================================================================
`;
exports[`module_nested.ts format 1`] = `
exports[`keyword.ts format[babel-ts] 1`] = `
"\`module ... {}\` declarations must have a string name. Use \`namespace ... {}\` instead. (1:1)
> 1 | module X {}
| ^
2 |
3 | module X {
4 | const x = 1;
Cause: \`module ... {}\` declarations must have a string name. Use \`namespace ... {}\` instead. (1:0)"
`;
exports[`module-nested.ts format 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80 (default) |
@@ -162,7 +183,17 @@ module abc4.def.ghi {}
================================================================================
`;
exports[`namespace_function.ts format 1`] = `
exports[`module-nested.ts format[babel-ts] 1`] = `
"\`module ... {}\` declarations must have a string name. Use \`namespace ... {}\` instead. (1:16)
> 1 | declare module abc1.def {}
| ^
2 |
3 | export declare module abc2.def {}
4 |
Cause: \`module ... {}\` declarations must have a string name. Use \`namespace ... {}\` instead. (1:15)"
`;
exports[`namespace-function.ts format 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80 (default) |
@@ -179,7 +210,7 @@ namespace X {
================================================================================
`;
exports[`namespace_nested.ts format 1`] = `
exports[`namespace-nested.ts format 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80 (default) |
@@ -1 +1,3 @@
runFormatTest(import.meta, ["typescript"]);
runFormatTest(import.meta, ["typescript"], {
errors: { "babel-ts": ["global.ts", "keyword.ts", "module-nested.ts"] },
});