diff --git a/src/harness/virtualFileSystemWithWatch.ts b/src/harness/virtualFileSystemWithWatch.ts
index 107a7890668..584a8ba6b21 100644
--- a/src/harness/virtualFileSystemWithWatch.ts
+++ b/src/harness/virtualFileSystemWithWatch.ts
@@ -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: `///
@@ -26,6 +14,18 @@ interface String { charAt: any; }
interface Array { 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 { 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 { 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 { 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 { 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);
}