diff --git a/src/harness/parallel/host.ts b/src/harness/parallel/host.ts index d7bba70408e7f..bf218c1b3a127 100644 --- a/src/harness/parallel/host.ts +++ b/src/harness/parallel/host.ts @@ -137,7 +137,7 @@ namespace Harness.Parallel.Host { let closedWorkers = 0; for (let i = 0; i < workerCount; i++) { // TODO: Just send the config over the IPC channel or in the command line arguments - const config: TestConfig = { light: Harness.lightMode, listenForWork: true, runUnitTests: runners.length !== 1 }; + const config: TestConfig = { light: Harness.lightMode, listenForWork: true, runUnitTests }; const configPath = ts.combinePaths(taskConfigsFolder, `task-config${i}.json`); Harness.IO.writeFile(configPath, JSON.stringify(config)); const child = fork(__filename, [`--config="${configPath}"`]); diff --git a/src/harness/runner.ts b/src/harness/runner.ts index c1345f422c394..db807b976bb18 100644 --- a/src/harness/runner.ts +++ b/src/harness/runner.ts @@ -82,7 +82,7 @@ let testConfigContent = let taskConfigsFolder: string; let workerCount: number; -let runUnitTests = true; +let runUnitTests: boolean | undefined; let noColors = false; interface TestConfig { @@ -108,9 +108,7 @@ function handleTestConfig() { if (testConfig.light) { Harness.lightMode = true; } - if (testConfig.runUnitTests !== undefined) { - runUnitTests = testConfig.runUnitTests; - } + runUnitTests = testConfig.runUnitTests; if (testConfig.workerCount) { workerCount = +testConfig.workerCount; } @@ -199,6 +197,9 @@ function handleTestConfig() { runners.push(new FourSlashRunner(FourSlashTestType.Server)); // runners.push(new GeneratedFourslashRunner()); } + if (runUnitTests === undefined) { + runUnitTests = runners.length !== 1; // Don't run unit tests when running only one runner if unit tests were not explicitly asked for + } } function beginTests() {