Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Whats the diff ? #52424

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/testRunner/unittests/tsbuild/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,8 @@ interface Symbol {
}
Harness.Baseline.runBaseline(
`${isBuild(commandLineArgs) ? "tsbuild" : "tsc"}/${scenario}/${subScenario.split(" ").join("-")}-discrepancies.js`,
baselines ? baselines.join("\r\n") : null // eslint-disable-line no-null/no-null
baselines ? baselines.join("\r\n") : null, // eslint-disable-line no-null/no-null
{ PrintDiff: true }
);
});
});
Expand Down
4 changes: 2 additions & 2 deletions src/testRunner/unittests/tsbuild/sample.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ namespace ts {
verifyBuildNextResult(); // logic
verifyBuildNextResult();// tests
verifyBuildNextResult(); // All Done
Harness.Baseline.runBaseline(`tsbuild/sample1/building-using-getNextInvalidatedProject.js`, baseline.join("\r\n"));
Harness.Baseline.runBaseline(`tsbuild/sample1/building-using-getNextInvalidatedProject.js`, baseline.join("\r\n"), { PrintDiff: true });

function verifyBuildNextResult() {
const project = builder.getNextInvalidatedProject();
Expand Down Expand Up @@ -365,7 +365,7 @@ namespace ts {
// Rebuild this project
system.appendFile(logicIndex.path, `export class cNew {}`);
verifyInvalidation("Dts change to Logic");
Harness.Baseline.runBaseline(`tsbuild/sample1/invalidates-projects-correctly.js`, baseline.join("\r\n"));
Harness.Baseline.runBaseline(`tsbuild/sample1/invalidates-projects-correctly.js`, baseline.join("\r\n"), { PrintDiff: true });

function verifyInvalidation(heading: string) {
// Rebuild this project
Expand Down
2 changes: 1 addition & 1 deletion src/testRunner/unittests/tsc/cancellationToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ namespace ts.tscWatch {
noChange("Clean build");
baselineCleanBuild();

Harness.Baseline.runBaseline(`tsc/cancellationToken/${scenario.split(" ").join("-")}.js`, baseline.join("\r\n"));
Harness.Baseline.runBaseline(`tsc/cancellationToken/${scenario.split(" ").join("-")}.js`, baseline.join("\r\n"), { PrintDiff: true });

function noChange(caption: string) {
oldSnap = applyChange(sys, baseline, noop, caption);
Expand Down
2 changes: 1 addition & 1 deletion src/testRunner/unittests/tsc/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ ${patch ? vfs.formatPatch(patch) : ""}`
export function verifyTscBaseline(sys: () => { baseLine: TscCompileSystem["baseLine"]; }) {
it(`Generates files matching the baseline`, () => {
const { file, text } = sys().baseLine();
Harness.Baseline.runBaseline(file, text);
Harness.Baseline.runBaseline(file, text, { PrintDiff: true });
});
}
export interface VerifyTscCompileLike {
Expand Down
2 changes: 1 addition & 1 deletion src/testRunner/unittests/tscWatch/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ namespace ts.tscWatch {
baselineDependencies,
});
}
Harness.Baseline.runBaseline(`${isBuild(commandLineArgs) ? "tsbuild" : "tsc"}${isWatch(commandLineArgs) ? "Watch" : ""}/${scenario}/${subScenario.split(" ").join("-")}.js`, baseline.join("\r\n"));
Harness.Baseline.runBaseline(`${isBuild(commandLineArgs) ? "tsbuild" : "tsc"}${isWatch(commandLineArgs) ? "Watch" : ""}/${scenario}/${subScenario.split(" ").join("-")}.js`, baseline.join("\r\n"), { PrintDiff: true });
}

function isWatch(commandLineArgs: readonly string[]) {
Expand Down
2 changes: 1 addition & 1 deletion src/testRunner/unittests/tscWatch/incremental.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace ts.tscWatch {
build(oldSnap);
}

Harness.Baseline.runBaseline(`${isBuild(argsToPass) ? "tsbuild/watchMode" : "tscWatch"}/incremental/${subScenario.split(" ").join("-")}-${incremental ? "incremental" : "watch"}.js`, baseline.join("\r\n"));
Harness.Baseline.runBaseline(`${isBuild(argsToPass) ? "tsbuild/watchMode" : "tscWatch"}/incremental/${subScenario.split(" ").join("-")}-${incremental ? "incremental" : "watch"}.js`, baseline.join("\r\n"), { PrintDiff: true });

function build(oldSnap: SystemSnap) {
const closer = executeCommandLine(
Expand Down
2 changes: 1 addition & 1 deletion src/testRunner/unittests/tscWatch/programUpdates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ export class A {
sys.checkTimeoutQueueLength(0);
baseline.push(`First program is not updated:: ${getPrograms() === emptyArray}`);
baseline.push(`Second program is not updated:: ${getPrograms2() === emptyArray}`);
Harness.Baseline.runBaseline(`tscWatch/${scenario}/two-watch-programs-are-not-affected-by-each-other.js`, baseline.join("\r\n"));
Harness.Baseline.runBaseline(`tscWatch/${scenario}/two-watch-programs-are-not-affected-by-each-other.js`, baseline.join("\r\n"), { PrintDiff: true });
});

verifyTscWatch({
Expand Down
10 changes: 5 additions & 5 deletions src/testRunner/unittests/tscWatch/watchApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,10 +390,10 @@ namespace ts.tscWatch {
emitBaseline = undefined!;
});
it("noEmit with composite writes the tsbuildinfo with pending affected files correctly", () => {
Harness.Baseline.runBaseline(`tscWatch/watchApi/noEmit-with-composite-with-semantic-builder.js`, baseline.join("\r\n"));
Harness.Baseline.runBaseline(`tscWatch/watchApi/noEmit-with-composite-with-semantic-builder.js`, baseline.join("\r\n"), { PrintDiff: true });
});
it("baseline in createEmitAndSemanticDiagnosticsBuilderProgram:: noEmit with composite writes the tsbuildinfo with pending affected files correctly", () => {
Harness.Baseline.runBaseline(`tscWatch/watchApi/noEmit-with-composite-with-emit-builder.js`, emitBaseline.join("\r\n"));
Harness.Baseline.runBaseline(`tscWatch/watchApi/noEmit-with-composite-with-emit-builder.js`, emitBaseline.join("\r\n"), { PrintDiff: true });
});
});

Expand Down Expand Up @@ -426,10 +426,10 @@ namespace ts.tscWatch {
});

it("noEmitOnError with composite writes the tsbuildinfo with pending affected files correctly", () => {
Harness.Baseline.runBaseline(`tscWatch/watchApi/noEmitOnError-with-composite-with-semantic-builder.js`, baseline.join("\r\n"));
Harness.Baseline.runBaseline(`tscWatch/watchApi/noEmitOnError-with-composite-with-semantic-builder.js`, baseline.join("\r\n"), { PrintDiff: true });
});
it("baseline in createEmitAndSemanticDiagnosticsBuilderProgram:: noEmitOnError with composite writes the tsbuildinfo with pending affected files correctly", () => {
Harness.Baseline.runBaseline(`tscWatch/watchApi/noEmitOnError-with-composite-with-emit-builder.js`, emitBaseline.join("\r\n"));
Harness.Baseline.runBaseline(`tscWatch/watchApi/noEmitOnError-with-composite-with-emit-builder.js`, emitBaseline.join("\r\n"), { PrintDiff: true });
});
});

Expand Down Expand Up @@ -473,7 +473,7 @@ namespace ts.tscWatch {
sys,
oldSnap,
});
Harness.Baseline.runBaseline(`tscWatch/watchApi/semantic-builder-emitOnlyDts.js`, baseline.join("\r\n"));
Harness.Baseline.runBaseline(`tscWatch/watchApi/semantic-builder-emitOnlyDts.js`, baseline.join("\r\n"), { PrintDiff: true });
});
});

Expand Down
2 changes: 1 addition & 1 deletion src/testRunner/unittests/tsserver/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ namespace ts.projectSystem {

export function baselineTsserverLogs(scenario: string, subScenario: string, sessionOrService: { logger: Logger; }) {
Debug.assert(sessionOrService.logger.logs.length); // Ensure caller used in memory logger
Harness.Baseline.runBaseline(`tsserver/${scenario}/${subScenario.split(" ").join("-")}.js`, sessionOrService.logger.logs.join("\r\n"));
Harness.Baseline.runBaseline(`tsserver/${scenario}/${subScenario.split(" ").join("-")}.js`, sessionOrService.logger.logs.join("\r\n"), { PrintDiff: true });
}

export function appendAllScriptInfos(service: server.ProjectService, logs: string[]) {
Expand Down