Skip to content

Commit dbcd899

Browse files
committed
A testcase
1 parent 9ca3738 commit dbcd899

File tree

5 files changed

+48
-0
lines changed

5 files changed

+48
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
tests/cases/compiler/satisfiesEmit.ts(2,20): error TS2307: Cannot find module 'foo' or its corresponding type declarations.
2+
tests/cases/compiler/satisfiesEmit.ts(3,23): error TS2304: Cannot find name 'bleh'.
3+
4+
5+
==== tests/cases/compiler/satisfiesEmit.ts (2 errors) ====
6+
// This import should not be elided in the emitted JS
7+
import a = require("foo");
8+
~~~~~
9+
!!! error TS2307: Cannot find module 'foo' or its corresponding type declarations.
10+
const p = a satisfies bleh;
11+
~~~~
12+
!!! error TS2304: Cannot find name 'bleh'.
13+
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//// [satisfiesEmit.ts]
2+
// This import should not be elided in the emitted JS
3+
import a = require("foo");
4+
const p = a satisfies bleh;
5+
6+
7+
//// [satisfiesEmit.js]
8+
"use strict";
9+
exports.__esModule = true;
10+
// This import should not be elided in the emitted JS
11+
var a = require("foo");
12+
var p = a;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
=== tests/cases/compiler/satisfiesEmit.ts ===
2+
// This import should not be elided in the emitted JS
3+
import a = require("foo");
4+
>a : Symbol(a, Decl(satisfiesEmit.ts, 0, 0))
5+
6+
const p = a satisfies bleh;
7+
>p : Symbol(p, Decl(satisfiesEmit.ts, 2, 5))
8+
>a : Symbol(a, Decl(satisfiesEmit.ts, 0, 0))
9+
>bleh : Symbol(bleh)
10+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
=== tests/cases/compiler/satisfiesEmit.ts ===
2+
// This import should not be elided in the emitted JS
3+
import a = require("foo");
4+
>a : any
5+
6+
const p = a satisfies bleh;
7+
>p : bleh
8+
>a satisfies bleh : bleh
9+
>a : any
10+

tests/cases/compiler/satisfiesEmit.ts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// This import should not be elided in the emitted JS
2+
import a = require("foo");
3+
const p = a satisfies bleh;

0 commit comments

Comments
 (0)