Skip to content

Commit 264b399

Browse files
author
Andy Hanson
committed
Test "foo/@bar"
1 parent 2fb6c12 commit 264b399

5 files changed

+18
-18
lines changed

tests/baselines/reference/moduleResolution_packageJson_notAtPackageRoot.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
export const x: number;
1313

1414
//// [a.ts]
15-
import { x } from "foo/bar";
15+
import { x } from "foo/@bar";
1616

1717

1818
//// [a.js]
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
=== /a.ts ===
2-
import { x } from "foo/bar";
2+
import { x } from "foo/@bar";
33
>x : Symbol(x, Decl(a.ts, 0, 8))
44

5-
=== /node_modules/foo/bar/types.d.ts ===
5+
=== /node_modules/foo/@bar/types.d.ts ===
66
export const x: number;
77
>x : Symbol(x, Decl(types.d.ts, 0, 12))
88

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[
2-
"======== Resolving module 'foo/bar' from '/a.ts'. ========",
2+
"======== Resolving module 'foo/@bar' from '/a.ts'. ========",
33
"Module resolution kind is not specified, using 'NodeJs'.",
4-
"Loading module 'foo/bar' from 'node_modules' folder, target file type 'TypeScript'.",
5-
"Found 'package.json' at '/node_modules/foo/bar/package.json'.",
6-
"File '/node_modules/foo/bar.ts' does not exist.",
7-
"File '/node_modules/foo/bar.tsx' does not exist.",
8-
"File '/node_modules/foo/bar.d.ts' does not exist.",
4+
"Loading module 'foo/@bar' from 'node_modules' folder, target file type 'TypeScript'.",
5+
"Found 'package.json' at '/node_modules/foo/@bar/package.json'.",
6+
"File '/node_modules/foo/@bar.ts' does not exist.",
7+
"File '/node_modules/foo/@bar.tsx' does not exist.",
8+
"File '/node_modules/foo/@bar.d.ts' does not exist.",
99
"'package.json' does not have a 'typings' field.",
10-
"'package.json' has 'types' field 'types.d.ts' that references '/node_modules/foo/bar/types.d.ts'.",
11-
"File '/node_modules/foo/bar/types.d.ts' exist - use it as a name resolution result.",
12-
"Resolving real path for '/node_modules/foo/bar/types.d.ts', result '/node_modules/foo/bar/types.d.ts'.",
13-
"======== Module name 'foo/bar' was successfully resolved to '/node_modules/foo/bar/types.d.ts'. ========"
10+
"'package.json' has 'types' field 'types.d.ts' that references '/node_modules/foo/@bar/types.d.ts'.",
11+
"File '/node_modules/foo/@bar/types.d.ts' exist - use it as a name resolution result.",
12+
"Resolving real path for '/node_modules/foo/@bar/types.d.ts', result '/node_modules/foo/@bar/types.d.ts'.",
13+
"======== Module name 'foo/@bar' was successfully resolved to '/node_modules/foo/@bar/types.d.ts'. ========"
1414
]
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
=== /a.ts ===
2-
import { x } from "foo/bar";
2+
import { x } from "foo/@bar";
33
>x : number
44

5-
=== /node_modules/foo/bar/types.d.ts ===
5+
=== /node_modules/foo/@bar/types.d.ts ===
66
export const x: number;
77
>x : number
88

tests/cases/compiler/moduleResolution_packageJson_notAtPackageRoot.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33

44
// Loads from a "fake" nested package.json, not from the one at the root.
55

6-
// @Filename: /node_modules/foo/bar/package.json
6+
// @Filename: /node_modules/foo/@bar/package.json
77
{ "types": "types.d.ts" }
88

99
// @Filename: /node_modules/foo/package.json
1010
{}
1111

12-
// @Filename: /node_modules/foo/bar/types.d.ts
12+
// @Filename: /node_modules/foo/@bar/types.d.ts
1313
export const x: number;
1414

1515
// @Filename: /a.ts
16-
import { x } from "foo/bar";
16+
import { x } from "foo/@bar";

0 commit comments

Comments
 (0)