From ab673e8349e0a219cd4fe230549cd7536ebc0348 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Wed, 25 May 2022 10:44:24 -0700 Subject: [PATCH] Little more diff cleanup --- src/harness/virtualFileSystemWithWatch.ts | 36 +++++++++++------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/harness/virtualFileSystemWithWatch.ts b/src/harness/virtualFileSystemWithWatch.ts index 2a5d7da0a56..ce18f9f839a 100644 --- a/src/harness/virtualFileSystemWithWatch.ts +++ b/src/harness/virtualFileSystemWithWatch.ts @@ -282,11 +282,11 @@ interface Array { length: number; [n: number]: T; }` export const timeIncrements = 1000; export class TestServerHost extends VirtualServerBaseHost implements server.ServerHost { - readonly screenClears: number[] = []; private readonly output: string[] = []; private time = timeIncrements; private timeoutCallbacks = new Callbacks(this); private immediateCallbacks = new Callbacks(this); + readonly screenClears: number[] = []; private readonly environmentVariables?: ESMap; public require: ((initialPath: string, moduleName: string) => RequireResult) | undefined; private readonly tscWatchFile?: string; @@ -340,6 +340,16 @@ interface Array { length: number; [n: number]: T; }` this.reloadFS(fileOrFolderOrSymLinkList); } + // Output is pretty + writeOutputIsTTY() { + return true; + } + + override now() { + this.time += timeIncrements; + return new Date(this.time); + } + getTime() { return this.time; } @@ -393,16 +403,6 @@ interface Array { length: number; [n: number]: T; }` } } - // Output is pretty - writeOutputIsTTY() { - return true; - } - - override now() { - this.time += timeIncrements; - return new Date(this.time); - } - renameFile(fileName: string, newFileName: string) { const fullPath = getNormalizedAbsolutePath(fileName, this.currentDirectory); const path = this.toPath(fullPath); @@ -557,13 +557,6 @@ interface Array { length: number; [n: number]: T; }` assert.equal(callbacksCount, expected, `expected ${expected} timeout callbacks queued but found ${callbacksCount}.`); } - runQueuedImmediateCallbacks(checkCount?: number) { - if (checkCount !== undefined) { - assert.equal(this.immediateCallbacks.count(), checkCount); - } - this.immediateCallbacks.invoke(); - } - runQueuedTimeoutCallbacks(timeoutId?: number) { try { this.timeoutCallbacks.invoke(timeoutId); @@ -576,6 +569,13 @@ interface Array { length: number; [n: number]: T; }` } } + runQueuedImmediateCallbacks(checkCount?: number) { + if (checkCount !== undefined) { + assert.equal(this.immediateCallbacks.count(), checkCount); + } + this.immediateCallbacks.invoke(); + } + setImmediate(callback: TimeOutCallback, ...args: any[]) { return this.immediateCallbacks.register(callback, args); }