Skip to content

Commit

Permalink
test: add test case for extension name !== emitExtension
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack-Works committed Dec 15, 2019
1 parent f318039 commit 5b9ffb0
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ tests/cases/compiler/1.ts(1,17): error TS2691: An import path cannot end with a


==== tests/cases/compiler/0.ts (0 errors) ====
// For the deno case
export default 0

==== tests/cases/compiler/1.ts (1 errors) ====
Expand Down
2 changes: 0 additions & 2 deletions tests/baselines/reference/emitExtensionRejectResolveTSFile.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//// [tests/cases/compiler/emitExtensionRejectResolveTSFile.ts] ////

//// [0.ts]
// For the deno case
export default 0

//// [1.ts]
Expand All @@ -12,7 +11,6 @@ num + 1
//// [0.mjs]
"use strict";
exports.__esModule = true;
// For the deno case
exports["default"] = 0;
//// [1.mjs]
"use strict";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
=== tests/cases/compiler/0.ts ===
// For the deno case
No type information for this code.export default 0
export default 0
No type information for this code.
No type information for this code.=== tests/cases/compiler/1.ts ===
import num from './0.ts'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
=== tests/cases/compiler/0.ts ===
// For the deno case
No type information for this code.export default 0
export default 0
No type information for this code.
No type information for this code.=== tests/cases/compiler/1.ts ===
import num from './0.ts'
Expand Down
12 changes: 12 additions & 0 deletions tests/baselines/reference/emitExtensionUnknownExtension.errors.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
tests/cases/compiler/1.ts(1,17): error TS2307: Cannot find module './0.cjs'.


==== tests/cases/compiler/0.ts (0 errors) ====
export default 0

==== tests/cases/compiler/1.ts (1 errors) ====
import num from './0.cjs'
~~~~~~~~~
!!! error TS2307: Cannot find module './0.cjs'.
num + 1

19 changes: 19 additions & 0 deletions tests/baselines/reference/emitExtensionUnknownExtension.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//// [tests/cases/compiler/emitExtensionUnknownExtension.ts] ////

//// [0.ts]
export default 0

//// [1.ts]
import num from './0.cjs'
num + 1


//// [0.mjs]
"use strict";
exports.__esModule = true;
exports["default"] = 0;
//// [1.mjs]
"use strict";
exports.__esModule = true;
var _0_cjs_1 = require("./0.cjs");
_0_cjs_1["default"] + 1;
10 changes: 10 additions & 0 deletions tests/baselines/reference/emitExtensionUnknownExtension.symbols
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
=== tests/cases/compiler/0.ts ===
export default 0
No type information for this code.
No type information for this code.=== tests/cases/compiler/1.ts ===
import num from './0.cjs'
>num : Symbol(num, Decl(1.ts, 0, 6))

num + 1
>num : Symbol(num, Decl(1.ts, 0, 6))

12 changes: 12 additions & 0 deletions tests/baselines/reference/emitExtensionUnknownExtension.types
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
=== tests/cases/compiler/0.ts ===
export default 0
No type information for this code.
No type information for this code.=== tests/cases/compiler/1.ts ===
import num from './0.cjs'
>num : any

num + 1
>num + 1 : any
>num : any
>1 : 1

1 change: 0 additions & 1 deletion tests/cases/compiler/emitExtensionRejectResolveTSFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// @outDir: ../out/

// @Filename: 0.ts
// For the deno case
export default 0

// @Filename: 1.ts
Expand Down
8 changes: 8 additions & 0 deletions tests/cases/compiler/emitExtensionUnknownExtension.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// @emitExtension: .mjs

// @Filename: 0.ts
export default 0

// @Filename: 1.ts
import num from './0.cjs'
num + 1

0 comments on commit 5b9ffb0

Please sign in to comment.