mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-30 01:04:49 -05:00
Allow 'paths' without 'baseUrl' (#40101)
* Allow paths without baseUrl * Remove exception for leading * paths * Add comment, remove commented code * Update baselines * Remove unnecessary default * Fix test harness * Fix baseline * Resolve relative to host.getCurrentDirectory() with createProgram API
This commit is contained in:
@@ -204,4 +204,20 @@ namespace ts {
|
||||
assert.isEmpty(program.getSemanticDiagnostics());
|
||||
});
|
||||
});
|
||||
|
||||
describe("unittests:: programApi:: CompilerOptions relative paths", () => {
|
||||
it("resolves relative paths by getCurrentDirectory", () => {
|
||||
const main = new documents.TextDocument("/main.ts", "import \"module\";");
|
||||
const mod = new documents.TextDocument("/lib/module.ts", "declare const foo: any;");
|
||||
|
||||
const fs = vfs.createFromFileSystem(Harness.IO, /*ignoreCase*/ false, { documents: [main, mod], cwd: "/" });
|
||||
const program = createProgram(["./main.ts"], {
|
||||
paths: { "*": ["./lib/*"] }
|
||||
}, new fakes.CompilerHost(fs, { newLine: NewLineKind.LineFeed }));
|
||||
|
||||
assert.isEmpty(program.getConfigFileParsingDiagnostics());
|
||||
assert.isEmpty(program.getGlobalDiagnostics());
|
||||
assert.isEmpty(program.getSemanticDiagnostics());
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user