Fix existing TypingsInstaller tests

This commit is contained in:
Jason Ramsay 2016-09-01 14:12:31 -07:00
parent 4f7a5185f8
commit 511b3cd69b
2 changed files with 5 additions and 9 deletions

View File

@ -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));
});

View File

@ -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");
});
});
}