Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…#18651) * Look at correct 'package.json' location for a scoped package * Update baseline
- Loading branch information
Andy
committed
Sep 21, 2017
1 parent
acfd670
commit 5538770
Showing
7 changed files
with
65 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
tests/baselines/reference/moduleResolution_packageJson_scopedPackage.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//// [tests/cases/compiler/moduleResolution_packageJson_scopedPackage.ts] //// | ||
|
||
//// [package.json] | ||
{ "types": "types.d.ts" } | ||
|
||
//// [types.d.ts] | ||
export const x: number; | ||
|
||
//// [a.ts] | ||
import { x } from "@foo/bar"; | ||
|
||
|
||
//// [a.js] | ||
"use strict"; | ||
exports.__esModule = true; |
8 changes: 8 additions & 0 deletions
8
tests/baselines/reference/moduleResolution_packageJson_scopedPackage.symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
=== /a.ts === | ||
import { x } from "@foo/bar"; | ||
>x : Symbol(x, Decl(a.ts, 0, 8)) | ||
|
||
=== /node_modules/@foo/bar/types.d.ts === | ||
export const x: number; | ||
>x : Symbol(x, Decl(types.d.ts, 0, 12)) | ||
|
14 changes: 14 additions & 0 deletions
14
tests/baselines/reference/moduleResolution_packageJson_scopedPackage.trace.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[ | ||
"======== Resolving module '@foo/bar' from '/a.ts'. ========", | ||
"Module resolution kind is not specified, using 'NodeJs'.", | ||
"Loading module '@foo/bar' from 'node_modules' folder, target file type 'TypeScript'.", | ||
"Found 'package.json' at '/node_modules/@foo/bar/package.json'.", | ||
"File '/node_modules/@foo/bar.ts' does not exist.", | ||
"File '/node_modules/@foo/bar.tsx' does not exist.", | ||
"File '/node_modules/@foo/bar.d.ts' does not exist.", | ||
"'package.json' does not have a 'typings' field.", | ||
"'package.json' has 'types' field 'types.d.ts' that references '/node_modules/@foo/bar/types.d.ts'.", | ||
"File '/node_modules/@foo/bar/types.d.ts' exist - use it as a name resolution result.", | ||
"Resolving real path for '/node_modules/@foo/bar/types.d.ts', result '/node_modules/@foo/bar/types.d.ts'.", | ||
"======== Module name '@foo/bar' was successfully resolved to '/node_modules/@foo/bar/types.d.ts'. ========" | ||
] |
8 changes: 8 additions & 0 deletions
8
tests/baselines/reference/moduleResolution_packageJson_scopedPackage.types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
=== /a.ts === | ||
import { x } from "@foo/bar"; | ||
>x : number | ||
|
||
=== /node_modules/@foo/bar/types.d.ts === | ||
export const x: number; | ||
>x : number | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
tests/cases/compiler/moduleResolution_packageJson_scopedPackage.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// @noImplicitReferences: true | ||
// @traceResolution: true | ||
|
||
// @Filename: /node_modules/@foo/bar/package.json | ||
{ "types": "types.d.ts" } | ||
|
||
// @Filename: /node_modules/@foo/bar/types.d.ts | ||
export const x: number; | ||
|
||
// @Filename: /a.ts | ||
import { x } from "@foo/bar"; |