Handle more places where package direcroy is converted to canonical file path (#50740)

* Add test for node16 resolution with package json lookup making casing incorrect

* Handle more places where package direcroy is converted to canonical file path
This commit is contained in:
Sheetal Nandi
2022-09-12 15:11:35 -07:00
committed by GitHub
parent f5f2923c7d
commit 6b890f93c4
13 changed files with 219 additions and 68 deletions

View File

@@ -326,5 +326,36 @@ a;b;
}, { currentDirectory: "/Users/name/projects/web" }),
changes: emptyArray,
});
verifyTscWatch({
scenario: "forceConsistentCasingInFileNames",
subScenario: "package json is looked up for file",
commandLineArgs: ["-w", "--explainFiles"],
sys: () => createWatchedSystem({
"/Users/name/projects/lib-boilerplate/package.json": JSON.stringify({
name: "lib-boilerplate",
version: "0.0.2",
type: "module",
exports: "./src/index.ts",
}),
"/Users/name/projects/lib-boilerplate/src/index.ts": Utils.dedent`
export function thing(): void {}
`,
"/Users/name/projects/lib-boilerplate/test/basic.spec.ts": Utils.dedent`
import { thing } from 'lib-boilerplate'
`,
"/Users/name/projects/lib-boilerplate/tsconfig.json": JSON.stringify({
compilerOptions: {
module: "node16",
target: "es2021",
forceConsistentCasingInFileNames: true,
traceResolution: true,
}
}),
"/a/lib/lib.es2021.full.d.ts": libFile.content,
}, { currentDirectory: "/Users/name/projects/lib-boilerplate" }),
changes: emptyArray,
});
});
}