Skip to content

Commit 5b9ffb0

Browse files
committed
test: add test case for extension name !== emitExtension
1 parent f318039 commit 5b9ffb0

10 files changed

+63
-8
lines changed

tests/baselines/reference/emitExtensionRejectResolveTSFile.errors.txt

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ tests/cases/compiler/1.ts(1,17): error TS2691: An import path cannot end with a
22

33

44
==== tests/cases/compiler/0.ts (0 errors) ====
5-
// For the deno case
65
export default 0
76

87
==== tests/cases/compiler/1.ts (1 errors) ====

tests/baselines/reference/emitExtensionRejectResolveTSFile.js

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//// [tests/cases/compiler/emitExtensionRejectResolveTSFile.ts] ////
22

33
//// [0.ts]
4-
// For the deno case
54
export default 0
65

76
//// [1.ts]
@@ -12,7 +11,6 @@ num + 1
1211
//// [0.mjs]
1312
"use strict";
1413
exports.__esModule = true;
15-
// For the deno case
1614
exports["default"] = 0;
1715
//// [1.mjs]
1816
"use strict";

tests/baselines/reference/emitExtensionRejectResolveTSFile.symbols

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
=== tests/cases/compiler/0.ts ===
2-
// For the deno case
3-
No type information for this code.export default 0
2+
export default 0
43
No type information for this code.
54
No type information for this code.=== tests/cases/compiler/1.ts ===
65
import num from './0.ts'

tests/baselines/reference/emitExtensionRejectResolveTSFile.types

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
=== tests/cases/compiler/0.ts ===
2-
// For the deno case
3-
No type information for this code.export default 0
2+
export default 0
43
No type information for this code.
54
No type information for this code.=== tests/cases/compiler/1.ts ===
65
import num from './0.ts'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
tests/cases/compiler/1.ts(1,17): error TS2307: Cannot find module './0.cjs'.
2+
3+
4+
==== tests/cases/compiler/0.ts (0 errors) ====
5+
export default 0
6+
7+
==== tests/cases/compiler/1.ts (1 errors) ====
8+
import num from './0.cjs'
9+
~~~~~~~~~
10+
!!! error TS2307: Cannot find module './0.cjs'.
11+
num + 1
12+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//// [tests/cases/compiler/emitExtensionUnknownExtension.ts] ////
2+
3+
//// [0.ts]
4+
export default 0
5+
6+
//// [1.ts]
7+
import num from './0.cjs'
8+
num + 1
9+
10+
11+
//// [0.mjs]
12+
"use strict";
13+
exports.__esModule = true;
14+
exports["default"] = 0;
15+
//// [1.mjs]
16+
"use strict";
17+
exports.__esModule = true;
18+
var _0_cjs_1 = require("./0.cjs");
19+
_0_cjs_1["default"] + 1;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
=== tests/cases/compiler/0.ts ===
2+
export default 0
3+
No type information for this code.
4+
No type information for this code.=== tests/cases/compiler/1.ts ===
5+
import num from './0.cjs'
6+
>num : Symbol(num, Decl(1.ts, 0, 6))
7+
8+
num + 1
9+
>num : Symbol(num, Decl(1.ts, 0, 6))
10+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
=== tests/cases/compiler/0.ts ===
2+
export default 0
3+
No type information for this code.
4+
No type information for this code.=== tests/cases/compiler/1.ts ===
5+
import num from './0.cjs'
6+
>num : any
7+
8+
num + 1
9+
>num + 1 : any
10+
>num : any
11+
>1 : 1
12+

tests/cases/compiler/emitExtensionRejectResolveTSFile.ts

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// @outDir: ../out/
33

44
// @Filename: 0.ts
5-
// For the deno case
65
export default 0
76

87
// @Filename: 1.ts
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// @emitExtension: .mjs
2+
3+
// @Filename: 0.ts
4+
export default 0
5+
6+
// @Filename: 1.ts
7+
import num from './0.cjs'
8+
num + 1

0 commit comments

Comments
 (0)