mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-15 03:23:08 -06:00
Fix existing TypingsInstaller tests
This commit is contained in:
parent
4f7a5185f8
commit
511b3cd69b
@ -56,15 +56,11 @@ namespace ts.projectSystem {
|
||||
return this.installTypingHost;
|
||||
}
|
||||
|
||||
installPackage(packageName: string) {
|
||||
return true;
|
||||
}
|
||||
|
||||
isPackageInstalled(packageName: string) {
|
||||
return true;
|
||||
}
|
||||
|
||||
runTsd(cachePath: string, typingsToInstall: string[], postInstallAction: (installedTypings: string[]) => void) {
|
||||
runInstall(cachePath: string, typingsToInstall: string[], postInstallAction: (installedTypings: string[]) => void) {
|
||||
this.postInstallActions.push(map => {
|
||||
postInstallAction(map(typingsToInstall));
|
||||
});
|
||||
|
||||
@ -157,7 +157,7 @@ namespace ts.projectSystem {
|
||||
};
|
||||
const host = createServerHost([file1]);
|
||||
let enqueueIsCalled = false;
|
||||
let runTsdIsCalled = false;
|
||||
let runInstallIsCalled = false;
|
||||
const installer = new (class extends TestTypingsInstaller {
|
||||
constructor() {
|
||||
super("", host);
|
||||
@ -168,8 +168,8 @@ namespace ts.projectSystem {
|
||||
}
|
||||
runTsd(cachePath: string, typingsToInstall: string[], postInstallAction: (installedTypings: string[]) => void): void {
|
||||
assert.deepEqual(typingsToInstall, ["node"]);
|
||||
runTsdIsCalled = true;
|
||||
super.runTsd(cachePath, typingsToInstall, postInstallAction);
|
||||
runInstallIsCalled = true;
|
||||
super.runInstall(cachePath, typingsToInstall, postInstallAction);
|
||||
}
|
||||
})();
|
||||
|
||||
@ -184,7 +184,7 @@ namespace ts.projectSystem {
|
||||
// autoDiscovery is set in typing options - use it even if project contains only .ts files
|
||||
projectService.checkNumberOfProjects({ externalProjects: 1 });
|
||||
assert.isTrue(enqueueIsCalled, "expected 'enqueueIsCalled' to be true");
|
||||
assert.isTrue(runTsdIsCalled, "expected 'runTsdIsCalled' to be true");
|
||||
assert.isTrue(runInstallIsCalled, "expected 'runInstallIsCalled' to be true");
|
||||
});
|
||||
});
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user