mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
When source file is redirected, set the prototype correctly in node factory (#48862)
Fixes #48039
This commit is contained in:
@@ -154,6 +154,7 @@
|
||||
"unittests/tsc/incremental.ts",
|
||||
"unittests/tsc/listFilesOnly.ts",
|
||||
"unittests/tsc/projectReferences.ts",
|
||||
"unittests/tsc/redirect.ts",
|
||||
"unittests/tsc/runWithoutArgs.ts",
|
||||
"unittests/tscWatch/consoleClearing.ts",
|
||||
"unittests/tscWatch/emit.ts",
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
namespace ts {
|
||||
describe("unittests:: tsc:: redirect::", () => {
|
||||
verifyTsc({
|
||||
scenario: "redirect",
|
||||
subScenario: "when redirecting ts file",
|
||||
fs: () => loadProjectFromFiles({
|
||||
"/src/project/tsconfig.json": JSON.stringify({
|
||||
compilerOptions: {
|
||||
outDir: "out"
|
||||
},
|
||||
include: [
|
||||
"copy1/node_modules/target/*",
|
||||
"copy2/node_modules/target/*",
|
||||
]
|
||||
}),
|
||||
"/src/project/copy1/node_modules/target/index.ts": "export const a = 1;",
|
||||
"/src/project/copy1/node_modules/target/import.ts": `import {} from "./";`,
|
||||
"/src/project/copy1/node_modules/target/package.json": JSON.stringify({
|
||||
name: "target",
|
||||
version: "1.0.0",
|
||||
main: "index.js",
|
||||
}),
|
||||
"/src/project/copy2/node_modules/target/index.ts": "export const a = 1;",
|
||||
"/src/project/copy2/node_modules/target/import.ts": `import {} from "./";`,
|
||||
"/src/project/copy2/node_modules/target/package.json": JSON.stringify({
|
||||
name: "target",
|
||||
version: "1.0.0",
|
||||
main: "index.js",
|
||||
}),
|
||||
}),
|
||||
commandLineArgs: ["-p", "src/project"],
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user