Skip to content

Commit f0a532d

Browse files
author
Andy Hanson
committed
Improve tests
1 parent 0b71f5f commit f0a532d

10 files changed

+60
-1
lines changed

tests/baselines/reference/relativeModuleWithoutSlash.js renamed to tests/baselines/reference/importWithTrailingSlash.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//// [tests/cases/compiler/relativeModuleWithoutSlash.ts] ////
1+
//// [tests/cases/compiler/importWithTrailingSlash.ts] ////
22

33
//// [a.ts]
44

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[
2+
"======== Resolving module '.' from '/a/test.ts'. ========",
3+
"Explicitly specified module resolution kind: 'NodeJs'.",
4+
"Loading module as file / folder, candidate module location '/a'.",
5+
"File '/a.ts' exist - use it as a name resolution result.",
6+
"Resolving real path for '/a.ts', result '/a.ts'",
7+
"======== Module name '.' was successfully resolved to '/a.ts'. ========",
8+
"======== Resolving module './' from '/a/test.ts'. ========",
9+
"Explicitly specified module resolution kind: 'NodeJs'.",
10+
"Loading module as file / folder, candidate module location '/a/'.",
11+
"File '/a/package.json' does not exist.",
12+
"File '/a/index.ts' exist - use it as a name resolution result.",
13+
"Resolving real path for '/a/index.ts', result '/a/index.ts'",
14+
"======== Module name './' was successfully resolved to '/a/index.ts'. ========",
15+
"======== Resolving module '..' from '/a/b/test.ts'. ========",
16+
"Explicitly specified module resolution kind: 'NodeJs'.",
17+
"Loading module as file / folder, candidate module location '/a'.",
18+
"File '/a.ts' exist - use it as a name resolution result.",
19+
"Resolving real path for '/a.ts', result '/a.ts'",
20+
"======== Module name '..' was successfully resolved to '/a.ts'. ========",
21+
"======== Resolving module '../' from '/a/b/test.ts'. ========",
22+
"Explicitly specified module resolution kind: 'NodeJs'.",
23+
"Loading module as file / folder, candidate module location '/a/'.",
24+
"File '/a/package.json' does not exist.",
25+
"File '/a/index.ts' exist - use it as a name resolution result.",
26+
"Resolving real path for '/a/index.ts', result '/a/index.ts'",
27+
"======== Module name '../' was successfully resolved to '/a/index.ts'. ========"
28+
]
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/a.ts(2,17): error TS2307: Cannot find module './foo/'.
2+
3+
4+
==== /a.ts (1 errors) ====
5+
6+
import foo from "./foo/";
7+
~~~~~~~~
8+
!!! error TS2307: Cannot find module './foo/'.
9+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
//// [a.ts]
2+
3+
import foo from "./foo/";
4+
5+
6+
//// [a.js]
7+
"use strict";
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[
2+
"======== Resolving module './foo/' from '/a.ts'. ========",
3+
"Explicitly specified module resolution kind: 'NodeJs'.",
4+
"Loading module as file / folder, candidate module location '/foo/'.",
5+
"File '/foo/package.json' does not exist.",
6+
"File '/foo/index.ts' does not exist.",
7+
"File '/foo/index.tsx' does not exist.",
8+
"File '/foo/index.d.ts' does not exist.",
9+
"======== Module name './foo/' was not resolved. ========"
10+
]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// @traceResolution: true
2+
// @moduleResolution: node
3+
4+
// @Filename: /a.ts
5+
import foo from "./foo/";

0 commit comments

Comments
 (0)