Skip to content

Commit cdceb66

Browse files
author
Stephan Brandauer
committed
add test for moduleSuffixes
1 parent d6abb2e commit cdceb66

File tree

5 files changed

+21
-1
lines changed

5 files changed

+21
-1
lines changed

javascript/ql/test/library-tests/TypeScript/Types/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"module": "esnext",
44
"target": "esnext",
55
"lib": ["dom", "esnext"],
6-
"resolveJsonModule": true
6+
"resolveJsonModule": true,
7+
"moduleSuffixes": [".ios", ""]
78
}
89
}

javascript/ql/test/library-tests/TypeScript/Types/tst.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,3 +363,13 @@ console.log(tstModuleCJS());
363363

364364
/////////////////
365365

366+
// test file resolution order (see tsconfig: moduleSuffixes setting)
367+
368+
import * as A from './tstSuffixA';
369+
370+
console.log(A.resolvedFile()); // <- 'tstSuffixA.ts'
371+
372+
import * as B from './tstSuffixB';
373+
374+
console.log(B.resolvedFile()); // <- 'tstSuffixB.ios.ts'
375+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export function resolvedFile(): 'tstSuffixA.ts' {
2+
return 'tstSuffixA.ts';
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export function resolvedFile(): 'tstSuffixB.ios.ts' {
2+
return 'tstSuffixB.ios.ts';
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export function resolvedFile(): 'tstSuffixB.ts' {
2+
return 'tstSuffixB.ts';
3+
}

0 commit comments

Comments
 (0)