Skip to content

Commit 5abc363

Browse files
committed
chore: failing test for const enums and isolatedModules
1 parent e789cb1 commit 5abc363

File tree

4 files changed

+78
-0
lines changed

4 files changed

+78
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//// [tests/cases/compiler/isolatedModulesImportConstEnum.ts] ////
2+
3+
//// [file1.ts]
4+
import { Foo } from './file2';
5+
console.log(Foo.BAR);
6+
7+
//// [file2.ts]
8+
export const enum Foo {
9+
BAR,
10+
}
11+
12+
13+
//// [file2.js]
14+
"use strict";
15+
exports.__esModule = true;
16+
exports.Foo = void 0;
17+
var Foo;
18+
(function (Foo) {
19+
Foo[Foo["BAR"] = 0] = "BAR";
20+
})(Foo = exports.Foo || (exports.Foo = {}));
21+
//// [file1.js]
22+
"use strict";
23+
exports.__esModule = true;
24+
console.log(file2_1.Foo.BAR);
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
=== tests/cases/compiler/file1.ts ===
2+
import { Foo } from './file2';
3+
>Foo : Symbol(Foo, Decl(file1.ts, 0, 8))
4+
5+
console.log(Foo.BAR);
6+
>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --))
7+
>console : Symbol(console, Decl(lib.dom.d.ts, --, --))
8+
>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --))
9+
>Foo.BAR : Symbol(Foo.BAR, Decl(file2.ts, 0, 23))
10+
>Foo : Symbol(Foo, Decl(file1.ts, 0, 8))
11+
>BAR : Symbol(Foo.BAR, Decl(file2.ts, 0, 23))
12+
13+
=== tests/cases/compiler/file2.ts ===
14+
export const enum Foo {
15+
>Foo : Symbol(Foo, Decl(file2.ts, 0, 0))
16+
17+
BAR,
18+
>BAR : Symbol(Foo.BAR, Decl(file2.ts, 0, 23))
19+
}
20+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
=== tests/cases/compiler/file1.ts ===
2+
import { Foo } from './file2';
3+
>Foo : typeof Foo
4+
5+
console.log(Foo.BAR);
6+
>console.log(Foo.BAR) : void
7+
>console.log : (...data: any[]) => void
8+
>console : Console
9+
>log : (...data: any[]) => void
10+
>Foo.BAR : Foo
11+
>Foo : typeof Foo
12+
>BAR : Foo
13+
14+
=== tests/cases/compiler/file2.ts ===
15+
export const enum Foo {
16+
>Foo : Foo
17+
18+
BAR,
19+
>BAR : Foo.BAR
20+
}
21+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// @isolatedModules: true
2+
// @module: commonjs
3+
4+
// @filename: file1.ts
5+
6+
import { Foo } from './file2';
7+
console.log(Foo.BAR);
8+
9+
// @filename: file2.ts
10+
11+
export const enum Foo {
12+
BAR,
13+
}

0 commit comments

Comments
 (0)