restore order of old code a bit

This commit is contained in:
Nathan Shively-Sanders
2022-04-01 17:03:12 -07:00
parent 5e0b517ac7
commit d0ad777cce
+23 -17
View File
@@ -1,16 +1,4 @@
namespace ts.TestFSWithWatch {
export const safeList = {
path: "/safeList.json" as Path,
content: JSON.stringify({
commander: "commander",
express: "express",
jquery: "jquery",
lodash: "lodash",
moment: "moment",
chroma: "chroma-js"
})
};
export const libFile: File = {
path: "/a/lib/lib.d.ts",
content: `/// <reference no-default-lib="true"/>
@@ -26,6 +14,18 @@ interface String { charAt: any; }
interface Array<T> { length: number; [n: number]: T; }`
};
export const safeList = {
path: "/safeList.json" as Path,
content: JSON.stringify({
commander: "commander",
express: "express",
jquery: "jquery",
lodash: "lodash",
moment: "moment",
chroma: "chroma-js"
})
};
function getExecutingFilePathFromLibFile(): string {
return combinePaths(getDirectoryPath(libFile.path), "tsc.js");
}
@@ -124,6 +124,7 @@ interface Array<T> { length: number; [n: number]: T; }`
export function checkWatchedFiles(host: TestServerHost, expectedFiles: readonly string[], additionalInfo?: string) {
checkMap(`watchedFiles:: ${additionalInfo || ""}::`, host.watchedFiles, expectedFiles, /*eachKeyCount*/ undefined);
}
export interface WatchFileDetails {
fileName: string;
pollingInterval: PollingInterval;
@@ -232,7 +233,12 @@ interface Array<T> { length: number; [n: number]: T; }`
public withSafeList: boolean,
fileOrFolderorSymLinkList: readonly FileOrFolderOrSymLink[],
options: TestServerHostCreationParameters = {}) {
super(fileOrFolderorSymLinkList.concat(withSafeList ? safeList : []), { ...options, executingFilePath: options.executingFilePath || getExecutingFilePathFromLibFile() });
super(
fileOrFolderorSymLinkList.concat(withSafeList ? safeList : []),
{
...options,
executingFilePath: options.executingFilePath || getExecutingFilePathFromLibFile()
});
}
runQueuedImmediateCallbacks(checkCount?: number) {
if (checkCount !== undefined) {
@@ -241,6 +247,10 @@ interface Array<T> { length: number; [n: number]: T; }`
super.runQueuedImmediateCallbacks();
}
clearScreen(): void {
this.screenClears.push(this.output.length);
}
checkTimeoutQueueLengthAndRun(expected: number) {
this.checkTimeoutQueueLength(expected);
this.runQueuedTimeoutCallbacks();
@@ -251,10 +261,6 @@ interface Array<T> { length: number; [n: number]: T; }`
assert.equal(callbacksCount, expected, `expected ${expected} timeout callbacks queued but found ${callbacksCount}.`);
}
clearScreen(): void {
this.screenClears.push(this.output.length);
}
override write(message: string) {
this.output.push(message);
}