Skip to content

Commit 4c5c985

Browse files
committed
test: add test for supress error 2961 when emitExtension is .ts
1 parent 08283f5 commit 4c5c985

5 files changed

+47
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
tests/cases/compiler/0.ts(2,17): error TS2307: Cannot find module './1.ts'.
2+
3+
4+
==== tests/cases/compiler/0.ts (1 errors) ====
5+
// should not emit error 2961
6+
import num from './1.ts'
7+
~~~~~~~~
8+
!!! error TS2307: Cannot find module './1.ts'.
9+
num + 1
10+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//// [0.ts]
2+
// should not emit error 2961
3+
import num from './1.ts'
4+
num + 1
5+
6+
7+
//// [0.ts]
8+
"use strict";
9+
exports.__esModule = true;
10+
// should not emit error 2961
11+
var _1_ts_1 = require("./1.ts");
12+
_1_ts_1["default"] + 1;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
=== tests/cases/compiler/0.ts ===
2+
// should not emit error 2961
3+
import num from './1.ts'
4+
>num : Symbol(num, Decl(0.ts, 1, 6))
5+
6+
num + 1
7+
>num : Symbol(num, Decl(0.ts, 1, 6))
8+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
=== tests/cases/compiler/0.ts ===
2+
// should not emit error 2961
3+
import num from './1.ts'
4+
>num : any
5+
6+
num + 1
7+
>num + 1 : any
8+
>num : any
9+
>1 : 1
10+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// @emitExtension: .ts
2+
// @outDir: ./out/
3+
4+
// @Filename: 0.ts
5+
// should not emit error 2961
6+
import num from './1.ts'
7+
num + 1

0 commit comments

Comments
 (0)