Skip to content

Commit 3dce7af

Browse files
committed
fixup! Update tests to use StringBufferTerminalProvider.getAllOutputAsChunks.
1 parent ca9e814 commit 3dce7af

File tree

14 files changed

+211
-253
lines changed

14 files changed

+211
-253
lines changed

libraries/heft-config-file/src/test/ConfigurationFile.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe('ConfigurationFile', () => {
2626
});
2727

2828
afterEach(() => {
29-
expect(terminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true })).toMatchSnapshot();
29+
expect(terminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot();
3030
});
3131

3232
describe('A simple config file', () => {

libraries/localization-utilities/src/parsers/test/parseResx.test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ describe(parseResx.name, () => {
1616
});
1717

1818
afterEach(() => {
19-
expect(terminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true })).toMatchSnapshot(
20-
'terminal output'
21-
);
19+
expect(terminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot('terminal output');
2220
});
2321

2422
async function testResxAsync(

libraries/operation-graph/src/test/OperationExecutionManager.test.ts

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,7 @@ describe(OperationExecutionManager.name, () => {
6868
});
6969

7070
expect(result).toBe(OperationStatus.NoOp);
71-
expect(
72-
terminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true })
73-
).toMatchSnapshot();
71+
expect(terminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot();
7472
});
7573

7674
it('handles trivial input', async () => {
@@ -89,9 +87,7 @@ describe(OperationExecutionManager.name, () => {
8987
});
9088

9189
expect(result).toBe(OperationStatus.Success);
92-
expect(
93-
terminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true })
94-
).toMatchSnapshot();
90+
expect(terminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot();
9591

9692
expect(operation.state?.status).toBe(OperationStatus.NoOp);
9793
});
@@ -139,9 +135,7 @@ describe(OperationExecutionManager.name, () => {
139135
});
140136

141137
expect(result).toBe(OperationStatus.Success);
142-
expect(
143-
terminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true })
144-
).toMatchSnapshot();
138+
expect(terminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot();
145139

146140
expect(runAlpha).toHaveBeenCalledTimes(1);
147141
expect(runBeta).toHaveBeenCalledTimes(1);
@@ -193,9 +187,7 @@ describe(OperationExecutionManager.name, () => {
193187
});
194188

195189
expect(result).toBe(OperationStatus.Failure);
196-
expect(
197-
terminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true })
198-
).toMatchSnapshot();
190+
expect(terminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot();
199191
expect(runAlpha).toHaveBeenCalledTimes(1);
200192
expect(runBeta).toHaveBeenCalledTimes(0);
201193

@@ -226,9 +218,7 @@ describe(OperationExecutionManager.name, () => {
226218
});
227219

228220
expect(result).toBe(OperationStatus.NoOp);
229-
expect(
230-
terminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true })
231-
).toMatchSnapshot();
221+
expect(terminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot();
232222
});
233223

234224
it('respects priority order', async () => {
@@ -281,9 +271,7 @@ describe(OperationExecutionManager.name, () => {
281271
expect(executed).toEqual([beta, alpha]);
282272

283273
expect(result).toBe(OperationStatus.Success);
284-
expect(
285-
terminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true })
286-
).toMatchSnapshot();
274+
expect(terminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot();
287275

288276
expect(runAlpha).toHaveBeenCalledTimes(1);
289277
expect(runBeta).toHaveBeenCalledTimes(1);
@@ -336,9 +324,7 @@ describe(OperationExecutionManager.name, () => {
336324
});
337325

338326
expect(result).toBe(OperationStatus.Success);
339-
expect(
340-
terminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true })
341-
).toMatchSnapshot();
327+
expect(terminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot();
342328

343329
expect(run).toHaveBeenCalledTimes(2);
344330

@@ -405,9 +391,7 @@ describe(OperationExecutionManager.name, () => {
405391
expect(betaRequestRun).toBeDefined();
406392

407393
expect(result1).toBe(OperationStatus.Success);
408-
expect(
409-
terminalProvider1.getAllOutputAsChunks({ asFlat: true, severityAsNames: true })
410-
).toMatchSnapshot('first');
394+
expect(terminalProvider1.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot('first');
411395

412396
expect(runAlpha).toHaveBeenCalledTimes(1);
413397
expect(runBeta).toHaveBeenCalledTimes(1);
@@ -439,9 +423,7 @@ describe(OperationExecutionManager.name, () => {
439423
});
440424

441425
expect(result2).toBe(OperationStatus.Success);
442-
expect(
443-
terminalProvider2.getAllOutputAsChunks({ asFlat: true, severityAsNames: true })
444-
).toMatchSnapshot('second');
426+
expect(terminalProvider2.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot('second');
445427

446428
expect(runAlpha).toHaveBeenCalledTimes(2);
447429
expect(runBeta).toHaveBeenCalledTimes(2);

libraries/rush-lib/src/api/test/CustomTipsConfiguration.test.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,7 @@ describe(CustomTipsConfiguration.name, () => {
5858
afterEach(() => {
5959
jest.restoreAllMocks();
6060

61-
const terminalProviderOutput: IOutputChunk<TerminalProviderSeverityName>[] =
62-
terminalProvider.getAllOutputAsChunks({
63-
severityAsNames: true
64-
});
61+
const terminalProviderOutput: IOutputChunk[] = terminalProvider.getAllOutputAsChunks();
6562
const lineSplitTerminalProviderOutput: string[] = [];
6663
for (const { text, severity } of terminalProviderOutput) {
6764
const lines: string[] = text.split('[n]');

libraries/rush-lib/src/api/test/RushProjectConfiguration.test.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,7 @@ function validateConfiguration(rushProjectConfiguration: RushProjectConfiguratio
6363
terminal
6464
);
6565
} finally {
66-
expect(
67-
terminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true })
68-
).toMatchSnapshot();
66+
expect(terminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot();
6967
}
7068
}
7169
}
@@ -92,9 +90,7 @@ function validateConfigurationWithParameters(
9290
terminal
9391
);
9492
} finally {
95-
expect(
96-
terminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true })
97-
).toMatchSnapshot();
93+
expect(terminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot();
9894
}
9995
}
10096
}

libraries/rush-lib/src/logic/operations/test/BuildPlanPlugin.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,7 @@ describe(BuildPlanPlugin.name, () => {
141141
expect(
142142
stringBufferTerminalProvider.getAllOutputAsChunks({
143143
normalizeSpecialCharacters: false,
144-
asFlat: true,
145-
severityAsNames: true
144+
asFlat: true
146145
})
147146
).toMatchSnapshot();
148147
});

libraries/rush-lib/src/logic/operations/test/OperationMetadataManager.test.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,7 @@ describe(OperationMetadataManager.name, () => {
6363
errorLogPath: '/path/to/errorLog'
6464
});
6565

66-
expect(
67-
mockTerminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true })
68-
).toMatchSnapshot();
66+
expect(mockTerminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot();
6967
expect(mockTerminalProvider.getWarningOutput()).toBeFalsy();
7068
});
7169

@@ -89,9 +87,7 @@ describe(OperationMetadataManager.name, () => {
8987
errorLogPath: '/path/to/errorLog'
9088
});
9189

92-
expect(
93-
mockTerminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true })
94-
).toMatchSnapshot();
90+
expect(mockTerminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot();
9591
});
9692

9793
it('should restore mixed chunked output', async () => {
@@ -113,9 +109,7 @@ describe(OperationMetadataManager.name, () => {
113109
terminalProvider: mockTerminalProvider,
114110
errorLogPath: '/path/to/errorLog'
115111
});
116-
expect(
117-
mockTerminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true })
118-
).toMatchSnapshot();
112+
expect(mockTerminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot();
119113
});
120114

121115
it("should fallback to the log file when chunked output isn't available", async () => {

libraries/rush-lib/src/logic/pnpm/test/PnpmShrinkwrapFile.test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -546,9 +546,7 @@ snapshots:
546546
terminal
547547
)
548548
).toThrowError(AlreadyReportedError);
549-
expect(
550-
terminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true })
551-
).toMatchSnapshot();
549+
expect(terminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot();
552550
});
553551
});
554552
});

libraries/rush-lib/src/logic/test/InstallHelpers.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ describe('InstallHelpers', () => {
2828
expect(
2929
terminalProvider.getAllOutputAsChunks({
3030
normalizeSpecialCharacters: true,
31-
asFlat: true,
32-
severityAsNames: true
31+
asFlat: true
3332
})
3433
).toMatchSnapshot('Terminal Output');
3534
mockJsonFileSave.mockClear();

libraries/rush-lib/src/logic/test/ProjectImpactGraphGenerator.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ async function runTestForExampleRepoAsync(
2525
expect(
2626
terminalProvider.getAllOutputAsChunks({
2727
normalizeSpecialCharacters: true,
28-
asFlat: true,
29-
severityAsNames: true
28+
asFlat: true
3029
})
3130
).toMatchSnapshot('Terminal Output');
3231
}

0 commit comments

Comments
 (0)