Skip to content

Commit 987a830

Browse files
committed
JS: Add test for import of d.ts file
1 parent 2e858db commit 987a830

File tree

6 files changed

+17
-0
lines changed

6 files changed

+17
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// This file has a corresponding .js file, which will be preferred by import resolution.
2+
3+
export const x: number;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const x = 42;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import * as declFile from "./only-declaration-file";
2+
import * as jsFile from "./has-javascript-file";
3+
4+
console.log(declFile.x);
5+
console.log(jsFile.x);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// This file has no corresponding implementation, so it should be seen by import resolution.
2+
3+
export const x: number;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
| main.ts:2:1:2:48 | import ... -file"; | ./has-javascript-file | has-javascript-file.js:1:1:2:0 | <toplevel> |
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import javascript
2+
3+
from Import imprt
4+
select imprt, imprt.getImportedPath().getValue(), imprt.getImportedModule()

0 commit comments

Comments
 (0)