Skip to content

Commit

Permalink
Remove redundant fsWatchWithTimestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
sheetalkamat committed Mar 29, 2024
1 parent 0cf33dd commit 16b4221
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ export interface TestServerHostCreationParameters {
environmentVariables?: Map<string, string>;
runWithFallbackPolling?: boolean;
inodeWatching?: boolean;
fsWatchWithTimestamp?: boolean;
osFlavor?: TestServerHostOsFlavor;
}

Expand Down Expand Up @@ -377,7 +376,6 @@ export class TestServerHost implements server.ServerHost, FormatDiagnosticsHost,
environmentVariables,
runWithFallbackPolling,
inodeWatching,
fsWatchWithTimestamp,
osFlavor,
}: TestServerHostCreationParameters = {},
) {
Expand Down Expand Up @@ -418,7 +416,7 @@ export class TestServerHost implements server.ServerHost, FormatDiagnosticsHost,
tscWatchFile,
tscWatchDirectory,
inodeWatching: !!this.inodeWatching,
fsWatchWithTimestamp,
fsWatchWithTimestamp: this.osFlavor === TestServerHostOsFlavor.MacOs,
sysLog: s => this.write(s + this.newLine),
});
this.watchFile = watchFile;
Expand Down
14 changes: 7 additions & 7 deletions src/testRunner/unittests/tscWatch/watchEnvironment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -691,10 +691,10 @@ describe("unittests:: tsc-watch:: watchEnvironment:: tsc-watch with different po
});

describe("with fsWatch with fsWatchWithTimestamp", () => {
function verify(fsWatchWithTimestamp: boolean, watchFile?: "useFsEventsOnParentDirectory") {
function verify(osFlavor: TestServerHostOsFlavor, watchFile?: "useFsEventsOnParentDirectory") {
verifyTscWatch({
scenario,
subScenario: `fsWatch/fsWatchWithTimestamp ${fsWatchWithTimestamp}${watchFile ? ` ${watchFile}` : ""}`,
subScenario: `fsWatch/fsWatchWithTimestamp ${osFlavor === TestServerHostOsFlavor.MacOs}${watchFile ? ` ${watchFile}` : ""}`,
commandLineArgs: ["-w", "--extendedDiagnostics", ...(watchFile ? ["--watchFile", watchFile] : [])],
sys: () =>
createWatchedSystem(
Expand All @@ -705,7 +705,7 @@ describe("unittests:: tsc-watch:: watchEnvironment:: tsc-watch with different po
},
{
currentDirectory: "/user/username/projects/myproject",
fsWatchWithTimestamp,
osFlavor,
},
),
edits: [
Expand All @@ -722,10 +722,10 @@ describe("unittests:: tsc-watch:: watchEnvironment:: tsc-watch with different po
],
});
}
verify(/*fsWatchWithTimestamp*/ true);
verify(/*fsWatchWithTimestamp*/ false);
verify(/*fsWatchWithTimestamp*/ true, "useFsEventsOnParentDirectory");
verify(/*fsWatchWithTimestamp*/ false, "useFsEventsOnParentDirectory");
verify(TestServerHostOsFlavor.MacOs);
verify(TestServerHostOsFlavor.Windows);
verify(TestServerHostOsFlavor.MacOs, "useFsEventsOnParentDirectory");
verify(TestServerHostOsFlavor.Windows, "useFsEventsOnParentDirectory");
});

verifyTscWatch({
Expand Down

0 comments on commit 16b4221

Please sign in to comment.