Skip to content

Commit 53f0a60

Browse files
committed
Add new test for node_modules searching behavior
1 parent 8def6f9 commit 53f0a60

File tree

5 files changed

+286
-0
lines changed

5 files changed

+286
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
error TS6504: File '/packages/a/node_modules/react/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option?
2+
The file is in the program because:
3+
Root file specified for compilation
4+
error TS6504: File '/packages/a/node_modules/redux/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option?
5+
The file is in the program because:
6+
Root file specified for compilation
7+
8+
9+
!!! error TS6504: File '/packages/a/node_modules/react/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option?
10+
!!! error TS6504: The file is in the program because:
11+
!!! error TS6504: Root file specified for compilation
12+
!!! error TS6504: File '/packages/a/node_modules/redux/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option?
13+
!!! error TS6504: The file is in the program because:
14+
!!! error TS6504: Root file specified for compilation
15+
==== /node_modules/@types/react/index.d.ts (0 errors) ====
16+
declare const React: any;
17+
export = React;
18+
19+
==== /node_modules/@types/redux/index.d.ts (0 errors) ====
20+
export declare function createStore(): void;
21+
22+
==== /packages/a/node_modules/react/index.js (0 errors) ====
23+
module.exports = {};
24+
25+
==== /packages/a/node_modules/redux/index.d.ts (0 errors) ====
26+
export declare function createStore(): void;
27+
28+
==== /packages/a/node_modules/redux/index.js (0 errors) ====
29+
module.exports = {};
30+
31+
==== /packages/a/index.ts (0 errors) ====
32+
import React from "react";
33+
import { createStore } from "redux";
34+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
=== /node_modules/@types/react/index.d.ts ===
2+
declare const React: any;
3+
>React : Symbol(React, Decl(index.d.ts, 0, 13))
4+
5+
export = React;
6+
>React : Symbol(React, Decl(index.d.ts, 0, 13))
7+
8+
=== /node_modules/@types/redux/index.d.ts ===
9+
export declare function createStore(): void;
10+
>createStore : Symbol(createStore, Decl(index.d.ts, 0, 0))
11+
12+
=== /packages/a/node_modules/redux/index.d.ts ===
13+
export declare function createStore(): void;
14+
>createStore : Symbol(createStore, Decl(index.d.ts, 0, 0))
15+
16+
=== /packages/a/index.ts ===
17+
import React from "react";
18+
>React : Symbol(React, Decl(index.ts, 0, 6))
19+
20+
import { createStore } from "redux";
21+
>createStore : Symbol(createStore, Decl(index.ts, 1, 8))
22+
Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
[
2+
"File '/node_modules/@types/react/package.json' does not exist.",
3+
"File '/node_modules/@types/package.json' does not exist.",
4+
"File '/node_modules/package.json' does not exist.",
5+
"File '/package.json' does not exist.",
6+
"File '/node_modules/@types/redux/package.json' does not exist.",
7+
"File '/node_modules/@types/package.json' does not exist according to earlier cached lookups.",
8+
"File '/node_modules/package.json' does not exist according to earlier cached lookups.",
9+
"File '/package.json' does not exist according to earlier cached lookups.",
10+
"File '/packages/a/node_modules/redux/package.json' does not exist.",
11+
"File '/packages/a/node_modules/package.json' does not exist.",
12+
"File '/packages/a/package.json' does not exist.",
13+
"File '/packages/package.json' does not exist.",
14+
"File '/package.json' does not exist according to earlier cached lookups.",
15+
"File '/packages/a/package.json' does not exist according to earlier cached lookups.",
16+
"File '/packages/package.json' does not exist according to earlier cached lookups.",
17+
"File '/package.json' does not exist according to earlier cached lookups.",
18+
"======== Resolving module 'react' from '/packages/a/index.ts'. ========",
19+
"Module resolution kind is not specified, using 'Node16'.",
20+
"Resolving in CJS mode with conditions 'node', 'require', 'types'.",
21+
"File '/packages/a/package.json' does not exist according to earlier cached lookups.",
22+
"File '/packages/package.json' does not exist according to earlier cached lookups.",
23+
"File '/package.json' does not exist according to earlier cached lookups.",
24+
"Loading module 'react' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.",
25+
"File '/packages/a/node_modules/react/package.json' does not exist.",
26+
"File '/packages/a/node_modules/react.ts' does not exist.",
27+
"File '/packages/a/node_modules/react.tsx' does not exist.",
28+
"File '/packages/a/node_modules/react.d.ts' does not exist.",
29+
"File '/packages/a/node_modules/react/index.ts' does not exist.",
30+
"File '/packages/a/node_modules/react/index.tsx' does not exist.",
31+
"File '/packages/a/node_modules/react/index.d.ts' does not exist.",
32+
"Directory '/packages/a/node_modules/@types' does not exist, skipping all lookups in it.",
33+
"Directory '/packages/node_modules' does not exist, skipping all lookups in it.",
34+
"File '/node_modules/react.ts' does not exist.",
35+
"File '/node_modules/react.tsx' does not exist.",
36+
"File '/node_modules/react.d.ts' does not exist.",
37+
"File '/node_modules/@types/react/package.json' does not exist according to earlier cached lookups.",
38+
"File '/node_modules/@types/react.d.ts' does not exist.",
39+
"File '/node_modules/@types/react/index.d.ts' exist - use it as a name resolution result.",
40+
"Resolving real path for '/node_modules/@types/react/index.d.ts', result '/node_modules/@types/react/index.d.ts'.",
41+
"======== Module name 'react' was successfully resolved to '/node_modules/@types/react/index.d.ts'. ========",
42+
"======== Resolving module 'redux' from '/packages/a/index.ts'. ========",
43+
"Module resolution kind is not specified, using 'Node16'.",
44+
"Resolving in CJS mode with conditions 'node', 'require', 'types'.",
45+
"File '/packages/a/package.json' does not exist according to earlier cached lookups.",
46+
"File '/packages/package.json' does not exist according to earlier cached lookups.",
47+
"File '/package.json' does not exist according to earlier cached lookups.",
48+
"Loading module 'redux' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration.",
49+
"File '/packages/a/node_modules/redux/package.json' does not exist according to earlier cached lookups.",
50+
"File '/packages/a/node_modules/redux.ts' does not exist.",
51+
"File '/packages/a/node_modules/redux.tsx' does not exist.",
52+
"File '/packages/a/node_modules/redux.d.ts' does not exist.",
53+
"File '/packages/a/node_modules/redux/index.ts' does not exist.",
54+
"File '/packages/a/node_modules/redux/index.tsx' does not exist.",
55+
"File '/packages/a/node_modules/redux/index.d.ts' exist - use it as a name resolution result.",
56+
"Resolving real path for '/packages/a/node_modules/redux/index.d.ts', result '/packages/a/node_modules/redux/index.d.ts'.",
57+
"======== Module name 'redux' was successfully resolved to '/packages/a/node_modules/redux/index.d.ts'. ========",
58+
"======== Resolving type reference directive 'react', containing file '__inferred type names__.ts', root directory '/node_modules/@types'. ========",
59+
"Resolving with primary search path '/node_modules/@types'.",
60+
"File '/node_modules/@types/react/package.json' does not exist according to earlier cached lookups.",
61+
"File '/node_modules/@types/react/index.d.ts' exist - use it as a name resolution result.",
62+
"Resolving real path for '/node_modules/@types/react/index.d.ts', result '/node_modules/@types/react/index.d.ts'.",
63+
"======== Type reference directive 'react' was successfully resolved to '/node_modules/@types/react/index.d.ts', primary: true. ========",
64+
"======== Resolving type reference directive 'redux', containing file '__inferred type names__.ts', root directory '/node_modules/@types'. ========",
65+
"Resolving with primary search path '/node_modules/@types'.",
66+
"File '/node_modules/@types/redux/package.json' does not exist according to earlier cached lookups.",
67+
"File '/node_modules/@types/redux/index.d.ts' exist - use it as a name resolution result.",
68+
"Resolving real path for '/node_modules/@types/redux/index.d.ts', result '/node_modules/@types/redux/index.d.ts'.",
69+
"======== Type reference directive 'redux' was successfully resolved to '/node_modules/@types/redux/index.d.ts', primary: true. ========",
70+
"File 'package.json' does not exist.",
71+
"File '/package.json' does not exist according to earlier cached lookups.",
72+
"File 'package.json' does not exist according to earlier cached lookups.",
73+
"File '/package.json' does not exist according to earlier cached lookups.",
74+
"File 'package.json' does not exist according to earlier cached lookups.",
75+
"File '/package.json' does not exist according to earlier cached lookups.",
76+
"File 'package.json' does not exist according to earlier cached lookups.",
77+
"File '/package.json' does not exist according to earlier cached lookups.",
78+
"File 'package.json' does not exist according to earlier cached lookups.",
79+
"File '/package.json' does not exist according to earlier cached lookups.",
80+
"File 'package.json' does not exist according to earlier cached lookups.",
81+
"File '/package.json' does not exist according to earlier cached lookups.",
82+
"File 'package.json' does not exist according to earlier cached lookups.",
83+
"File '/package.json' does not exist according to earlier cached lookups.",
84+
"File 'package.json' does not exist according to earlier cached lookups.",
85+
"File '/package.json' does not exist according to earlier cached lookups.",
86+
"File 'package.json' does not exist according to earlier cached lookups.",
87+
"File '/package.json' does not exist according to earlier cached lookups.",
88+
"File 'package.json' does not exist according to earlier cached lookups.",
89+
"File '/package.json' does not exist according to earlier cached lookups.",
90+
"File 'package.json' does not exist according to earlier cached lookups.",
91+
"File '/package.json' does not exist according to earlier cached lookups.",
92+
"File 'package.json' does not exist according to earlier cached lookups.",
93+
"File '/package.json' does not exist according to earlier cached lookups.",
94+
"File 'package.json' does not exist according to earlier cached lookups.",
95+
"File '/package.json' does not exist according to earlier cached lookups.",
96+
"File 'package.json' does not exist according to earlier cached lookups.",
97+
"File '/package.json' does not exist according to earlier cached lookups.",
98+
"File 'package.json' does not exist according to earlier cached lookups.",
99+
"File '/package.json' does not exist according to earlier cached lookups.",
100+
"File 'package.json' does not exist according to earlier cached lookups.",
101+
"File '/package.json' does not exist according to earlier cached lookups.",
102+
"File 'package.json' does not exist according to earlier cached lookups.",
103+
"File '/package.json' does not exist according to earlier cached lookups.",
104+
"File 'package.json' does not exist according to earlier cached lookups.",
105+
"File '/package.json' does not exist according to earlier cached lookups.",
106+
"File 'package.json' does not exist according to earlier cached lookups.",
107+
"File '/package.json' does not exist according to earlier cached lookups.",
108+
"File 'package.json' does not exist according to earlier cached lookups.",
109+
"File '/package.json' does not exist according to earlier cached lookups.",
110+
"File 'package.json' does not exist according to earlier cached lookups.",
111+
"File '/package.json' does not exist according to earlier cached lookups.",
112+
"File 'package.json' does not exist according to earlier cached lookups.",
113+
"File '/package.json' does not exist according to earlier cached lookups.",
114+
"File 'package.json' does not exist according to earlier cached lookups.",
115+
"File '/package.json' does not exist according to earlier cached lookups.",
116+
"File 'package.json' does not exist according to earlier cached lookups.",
117+
"File '/package.json' does not exist according to earlier cached lookups.",
118+
"File 'package.json' does not exist according to earlier cached lookups.",
119+
"File '/package.json' does not exist according to earlier cached lookups.",
120+
"File 'package.json' does not exist according to earlier cached lookups.",
121+
"File '/package.json' does not exist according to earlier cached lookups.",
122+
"File 'package.json' does not exist according to earlier cached lookups.",
123+
"File '/package.json' does not exist according to earlier cached lookups.",
124+
"File 'package.json' does not exist according to earlier cached lookups.",
125+
"File '/package.json' does not exist according to earlier cached lookups.",
126+
"File 'package.json' does not exist according to earlier cached lookups.",
127+
"File '/package.json' does not exist according to earlier cached lookups.",
128+
"File 'package.json' does not exist according to earlier cached lookups.",
129+
"File '/package.json' does not exist according to earlier cached lookups.",
130+
"File 'package.json' does not exist according to earlier cached lookups.",
131+
"File '/package.json' does not exist according to earlier cached lookups.",
132+
"File 'package.json' does not exist according to earlier cached lookups.",
133+
"File '/package.json' does not exist according to earlier cached lookups.",
134+
"File 'package.json' does not exist according to earlier cached lookups.",
135+
"File '/package.json' does not exist according to earlier cached lookups.",
136+
"File 'package.json' does not exist according to earlier cached lookups.",
137+
"File '/package.json' does not exist according to earlier cached lookups.",
138+
"File 'package.json' does not exist according to earlier cached lookups.",
139+
"File '/package.json' does not exist according to earlier cached lookups.",
140+
"File 'package.json' does not exist according to earlier cached lookups.",
141+
"File '/package.json' does not exist according to earlier cached lookups.",
142+
"File 'package.json' does not exist according to earlier cached lookups.",
143+
"File '/package.json' does not exist according to earlier cached lookups.",
144+
"File 'package.json' does not exist according to earlier cached lookups.",
145+
"File '/package.json' does not exist according to earlier cached lookups.",
146+
"File 'package.json' does not exist according to earlier cached lookups.",
147+
"File '/package.json' does not exist according to earlier cached lookups.",
148+
"File 'package.json' does not exist according to earlier cached lookups.",
149+
"File '/package.json' does not exist according to earlier cached lookups.",
150+
"File 'package.json' does not exist according to earlier cached lookups.",
151+
"File '/package.json' does not exist according to earlier cached lookups.",
152+
"File 'package.json' does not exist according to earlier cached lookups.",
153+
"File '/package.json' does not exist according to earlier cached lookups.",
154+
"File 'package.json' does not exist according to earlier cached lookups.",
155+
"File '/package.json' does not exist according to earlier cached lookups.",
156+
"File 'package.json' does not exist according to earlier cached lookups.",
157+
"File '/package.json' does not exist according to earlier cached lookups.",
158+
"File 'package.json' does not exist according to earlier cached lookups.",
159+
"File '/package.json' does not exist according to earlier cached lookups.",
160+
"File 'package.json' does not exist according to earlier cached lookups.",
161+
"File '/package.json' does not exist according to earlier cached lookups.",
162+
"File 'package.json' does not exist according to earlier cached lookups.",
163+
"File '/package.json' does not exist according to earlier cached lookups.",
164+
"File 'package.json' does not exist according to earlier cached lookups.",
165+
"File '/package.json' does not exist according to earlier cached lookups.",
166+
"File 'package.json' does not exist according to earlier cached lookups.",
167+
"File '/package.json' does not exist according to earlier cached lookups.",
168+
"File 'package.json' does not exist according to earlier cached lookups.",
169+
"File '/package.json' does not exist according to earlier cached lookups.",
170+
"File 'package.json' does not exist according to earlier cached lookups.",
171+
"File '/package.json' does not exist according to earlier cached lookups.",
172+
"File 'package.json' does not exist according to earlier cached lookups.",
173+
"File '/package.json' does not exist according to earlier cached lookups.",
174+
"File 'package.json' does not exist according to earlier cached lookups.",
175+
"File '/package.json' does not exist according to earlier cached lookups.",
176+
"File 'package.json' does not exist according to earlier cached lookups.",
177+
"File '/package.json' does not exist according to earlier cached lookups.",
178+
"File 'package.json' does not exist according to earlier cached lookups.",
179+
"File '/package.json' does not exist according to earlier cached lookups.",
180+
"File 'package.json' does not exist according to earlier cached lookups.",
181+
"File '/package.json' does not exist according to earlier cached lookups.",
182+
"File 'package.json' does not exist according to earlier cached lookups.",
183+
"File '/package.json' does not exist according to earlier cached lookups."
184+
]
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
=== /node_modules/@types/react/index.d.ts ===
2+
declare const React: any;
3+
>React : any
4+
5+
export = React;
6+
>React : any
7+
8+
=== /node_modules/@types/redux/index.d.ts ===
9+
export declare function createStore(): void;
10+
>createStore : () => void
11+
12+
=== /packages/a/node_modules/redux/index.d.ts ===
13+
export declare function createStore(): void;
14+
>createStore : () => void
15+
16+
=== /packages/a/index.ts ===
17+
import React from "react";
18+
>React : any
19+
20+
import { createStore } from "redux";
21+
>createStore : () => void
22+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// @module: node16
2+
// @strict: true
3+
// @noEmit: true
4+
// @traceResolution: true
5+
6+
// @Filename: /node_modules/@types/react/index.d.ts
7+
declare const React: any;
8+
export = React;
9+
10+
// @Filename: /node_modules/@types/redux/index.d.ts
11+
export declare function createStore(): void;
12+
13+
// @Filename: /packages/a/node_modules/react/index.js
14+
module.exports = {};
15+
16+
// @Filename: /packages/a/node_modules/redux/index.d.ts
17+
export declare function createStore(): void;
18+
19+
// @Filename: /packages/a/node_modules/redux/index.js
20+
module.exports = {};
21+
22+
// @Filename: /packages/a/index.ts
23+
import React from "react";
24+
import { createStore } from "redux";

0 commit comments

Comments
 (0)