Skip to content

Commit d8b541a

Browse files
author
Andy Hanson
committed
Fix test
1 parent 7079d04 commit d8b541a

5 files changed

+12
-106
lines changed

tests/baselines/reference/moduleResolutionWithSymlinks_referenceTypes.js

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -15,59 +15,8 @@ declare class MyClass { private x: number; }
1515
//// [app.ts]
1616
/// <reference types="library-a" />
1717
/// <reference types="library-b" />
18-
19-
/*
20-
# To reproduce in a real project:
21-
22-
echo '/// <reference types="library-a" />' > app.ts
23-
echo '/// <reference types="library-b" />' >> app.ts
24-
25-
mkdir node_modules/@types
26-
cd mode_modules/@types
27-
mkdir library-a
28-
echo 'declare class MyClass { private x: number; }' > library-a/index.d.ts
29-
30-
mkdir library-b
31-
cd library-b
32-
echo '/// <reference types="library-a" />' > index.d.ts
33-
34-
mkdir node_modules
35-
cd node_modules
36-
37-
ln -s ../../library-a ./library-a
38-
# Windows: Open command prompt as administrator and run: `mklink /D library-a ..\..\library-a`
39-
40-
cd ../../.. # back to root
41-
42-
tsc app.ts # Should create `app.js`
43-
*/
4418

4519

4620
//// [/app.js]
4721
/// <reference types="library-a" />
4822
/// <reference types="library-b" />
49-
/*
50-
# To reproduce in a real project:
51-
52-
echo '/// <reference types="library-a" />' > app.ts
53-
echo '/// <reference types="library-b" />' >> app.ts
54-
55-
mkdir node_modules/@types
56-
cd mode_modules/@types
57-
mkdir library-a
58-
echo 'declare class MyClass { private x: number; }' > library-a/index.d.ts
59-
60-
mkdir library-b
61-
cd library-b
62-
echo '/// <reference types="library-a" />' > index.d.ts
63-
64-
mkdir node_modules
65-
cd node_modules
66-
67-
ln -s ../../library-a ./library-a
68-
# Windows: Open command prompt as administrator and run: `mklink /D library-a ..\..\library-a`
69-
70-
cd ../../.. # back to root
71-
72-
tsc app.ts # Should create `app.js`
73-
*/

tests/baselines/reference/moduleResolutionWithSymlinks_referenceTypes.symbols

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,6 @@
22
/// <reference types="library-a" />
33
No type information for this code./// <reference types="library-b" />
44
No type information for this code.
5-
No type information for this code./*
6-
No type information for this code.# To reproduce in a real project:
7-
No type information for this code.
8-
No type information for this code.echo '/// <reference types="library-a" />' > app.ts
9-
No type information for this code.echo '/// <reference types="library-b" />' >> app.ts
10-
No type information for this code.
11-
No type information for this code.mkdir node_modules/@types
12-
No type information for this code.cd mode_modules/@types
13-
No type information for this code.mkdir library-a
14-
No type information for this code.echo 'declare class MyClass { private x: number; }' > library-a/index.d.ts
15-
No type information for this code.
16-
No type information for this code.mkdir library-b
17-
No type information for this code.cd library-b
18-
No type information for this code.echo '/// <reference types="library-a" />' > index.d.ts
19-
No type information for this code.
20-
No type information for this code.mkdir node_modules
21-
No type information for this code.cd node_modules
22-
No type information for this code.
23-
No type information for this code.ln -s ../../library-a ./library-a
24-
No type information for this code.# Windows: Open command prompt as administrator and run: `mklink /D library-a ..\..\library-a`
25-
No type information for this code.
26-
No type information for this code.cd ../../.. # back to root
27-
No type information for this code.
28-
No type information for this code.tsc app.ts # Should create `app.js`
29-
No type information for this code.*/
30-
No type information for this code.
315
No type information for this code.=== /node_modules/@types/library-a/index.d.ts ===
326
// Symlinks are always resolved for type reference directives.
337
// NOTE: This test would still compile without errors even if they were not,

tests/baselines/reference/moduleResolutionWithSymlinks_referenceTypes.trace.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[
2-
"======== Resolving type reference directive 'library-a', containing file '/app.ts', root directory not set. ========",
2+
"======== Resolving type reference directive 'library-a', containing file '/app.ts', root directory ''. ========",
33
"Root directory cannot be determined, skipping primary search paths.",
44
"Looking up in 'node_modules' folder, initial location '/'",
55
"File '/node_modules/library-a.d.ts' does not exist.",
@@ -10,7 +10,7 @@
1010
"File '/node_modules/@types/library-a/index.d.ts' exist - use it as a name resolution result.",
1111
"Resolving real path for '/node_modules/@types/library-a/index.d.ts', result '/node_modules/@types/library-a/index.d.ts'",
1212
"======== Type reference directive 'library-a' was successfully resolved to '/node_modules/@types/library-a/index.d.ts', primary: false. ========",
13-
"======== Resolving type reference directive 'library-b', containing file '/app.ts', root directory not set. ========",
13+
"======== Resolving type reference directive 'library-b', containing file '/app.ts', root directory ''. ========",
1414
"Root directory cannot be determined, skipping primary search paths.",
1515
"Looking up in 'node_modules' folder, initial location '/'",
1616
"File '/node_modules/library-b.d.ts' does not exist.",
@@ -21,7 +21,7 @@
2121
"File '/node_modules/@types/library-b/index.d.ts' exist - use it as a name resolution result.",
2222
"Resolving real path for '/node_modules/@types/library-b/index.d.ts', result '/node_modules/@types/library-b/index.d.ts'",
2323
"======== Type reference directive 'library-b' was successfully resolved to '/node_modules/@types/library-b/index.d.ts', primary: false. ========",
24-
"======== Resolving type reference directive 'library-a', containing file '/node_modules/@types/library-b/index.d.ts', root directory not set. ========",
24+
"======== Resolving type reference directive 'library-a', containing file '/node_modules/@types/library-b/index.d.ts', root directory ''. ========",
2525
"Root directory cannot be determined, skipping primary search paths.",
2626
"Looking up in 'node_modules' folder, initial location '/node_modules/@types/library-b'",
2727
"File '/node_modules/@types/library-b/node_modules/library-a.d.ts' does not exist.",

tests/baselines/reference/moduleResolutionWithSymlinks_referenceTypes.types

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,6 @@
22
/// <reference types="library-a" />
33
No type information for this code./// <reference types="library-b" />
44
No type information for this code.
5-
No type information for this code./*
6-
No type information for this code.# To reproduce in a real project:
7-
No type information for this code.
8-
No type information for this code.echo '/// <reference types="library-a" />' > app.ts
9-
No type information for this code.echo '/// <reference types="library-b" />' >> app.ts
10-
No type information for this code.
11-
No type information for this code.mkdir node_modules/@types
12-
No type information for this code.cd mode_modules/@types
13-
No type information for this code.mkdir library-a
14-
No type information for this code.echo 'declare class MyClass { private x: number; }' > library-a/index.d.ts
15-
No type information for this code.
16-
No type information for this code.mkdir library-b
17-
No type information for this code.cd library-b
18-
No type information for this code.echo '/// <reference types="library-a" />' > index.d.ts
19-
No type information for this code.
20-
No type information for this code.mkdir node_modules
21-
No type information for this code.cd node_modules
22-
No type information for this code.
23-
No type information for this code.ln -s ../../library-a ./library-a
24-
No type information for this code.# Windows: Open command prompt as administrator and run: `mklink /D library-a ..\..\library-a`
25-
No type information for this code.
26-
No type information for this code.cd ../../.. # back to root
27-
No type information for this code.
28-
No type information for this code.tsc app.ts # Should create `app.js`
29-
No type information for this code.*/
30-
No type information for this code.
315
No type information for this code.=== /node_modules/@types/library-a/index.d.ts ===
326
// Symlinks are always resolved for type reference directives.
337
// NOTE: This test would still compile without errors even if they were not,

tests/cases/compiler/moduleResolutionWithSymlinks_referenceTypes.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@ declare class MyClass { private x: number; }
1818
/// <reference types="library-a" />
1919
/// <reference types="library-b" />
2020

21+
// @filename: tsconfig.json
22+
{
23+
"compilerOptions": {
24+
// If this is its default of node_modules/@types,
25+
// node_modules/@types/library-a will be looked up be fore node_modules/@types/library-b/node_modules/@types/library-a
26+
"typeRoots": []
27+
}
28+
}
29+
2130
/*
2231
# To reproduce in a real project:
2332

0 commit comments

Comments
 (0)