mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 08:11:30 -06:00
add test
This commit is contained in:
parent
95494efe50
commit
27d2a2d564
@ -194,6 +194,21 @@ namespace ts {
|
||||
});
|
||||
|
||||
describe("Node module resolution - non-relative paths", () => {
|
||||
it("computes correct commonPrefix for moduleName cache", () => {
|
||||
const cache = createModuleResolutionCache("/", (f) => f).getOrCreateCacheForModuleName("a");
|
||||
cache.set("/sub", {
|
||||
resolvedModule: {
|
||||
originalPath: undefined,
|
||||
resolvedFileName: "/sub/node_modules/a/index.ts",
|
||||
isExternalLibraryImport: true,
|
||||
extension: Extension.Ts,
|
||||
},
|
||||
failedLookupLocations: [],
|
||||
});
|
||||
assert.isDefined(cache.get("/sub"));
|
||||
assert.isUndefined(cache.get("/"));
|
||||
});
|
||||
|
||||
it("load module as file - ts files not loaded", () => {
|
||||
test(/*hasDirectoryExists*/ false);
|
||||
test(/*hasDirectoryExists*/ true);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user