From cd6a0249490357c177e2dc1cd9ca12c6c56c6167 Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Sat, 3 Jan 2026 19:39:40 -0500 Subject: [PATCH 01/14] Add a StringBufferTerminalProvider.getAllOutputAsChunks function that returns an array of chunks that were written to the terminal provider. --- .../terminal/main_2026-01-04-00-39.json | 10 ++ common/reviews/api/terminal.api.md | 40 ++++++- .../src/StringBufferTerminalProvider.ts | 105 ++++++++++++++++-- libraries/terminal/src/index.ts | 5 +- 4 files changed, 150 insertions(+), 10 deletions(-) create mode 100644 common/changes/@rushstack/terminal/main_2026-01-04-00-39.json diff --git a/common/changes/@rushstack/terminal/main_2026-01-04-00-39.json b/common/changes/@rushstack/terminal/main_2026-01-04-00-39.json new file mode 100644 index 0000000000..2483ca2509 --- /dev/null +++ b/common/changes/@rushstack/terminal/main_2026-01-04-00-39.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@rushstack/terminal", + "comment": "Add a `getAllOutputAsChunks` function to `StringBufferTerminalProvider` that returns an array of chunks that were written to the terminal provider.", + "type": "minor" + } + ], + "packageName": "@rushstack/terminal" +} \ No newline at end of file diff --git a/common/reviews/api/terminal.api.md b/common/reviews/api/terminal.api.md index 419a4c1c2f..b895e6927b 100644 --- a/common/reviews/api/terminal.api.md +++ b/common/reviews/api/terminal.api.md @@ -151,6 +151,14 @@ export interface INormalizeNewlinesTextRewriterOptions { newlineKind: NewlineKind; } +// @beta (undocumented) +export interface IOutputChunk { + // (undocumented) + severity: TSeverity; + // (undocumented) + text: string; +} + // @beta (undocumented) export type IPrefixProxyTerminalProviderOptions = IStaticPrefixProxyTerminalProviderOptions | IDynamicPrefixProxyTerminalProviderOptions; @@ -192,9 +200,15 @@ export interface IStdioSummarizerOptions extends ITerminalWritableOptions { trailingLines?: number; } +// @beta (undocumented) +export interface IStringBufferOutputChunksOptions extends IStringBufferOutputOptions { + asFlat?: boolean; + severityAsNames?: boolean; +} + // @beta (undocumented) export interface IStringBufferOutputOptions { - normalizeSpecialCharacters: boolean; + normalizeSpecialCharacters?: boolean; } // @beta (undocumented) @@ -378,6 +392,25 @@ export class StdioWritable extends TerminalWritable { export class StringBufferTerminalProvider implements ITerminalProvider { constructor(supportsColor?: boolean); get eolCharacter(): string; + getAllOutputAsChunks(options?: IStringBufferOutputChunksOptions & { + severityAsNames?: false; + asFlat?: false; + }): IOutputChunk[]; + // (undocumented) + getAllOutputAsChunks(options: IStringBufferOutputChunksOptions & { + severityAsNames: true; + asFlat?: false; + }): IOutputChunk[]; + // (undocumented) + getAllOutputAsChunks(options?: IStringBufferOutputChunksOptions & { + severityAsNames?: false; + asFlat: true; + }): `[${TerminalProviderSeverity}] ${string}`[]; + // (undocumented) + getAllOutputAsChunks(options: IStringBufferOutputChunksOptions & { + severityAsNames: true; + asFlat: true; + }): `[${string}] ${string}`[]; getAllOutput(sparse?: false, options?: IStringBufferOutputOptions): IAllStringBufferOutput; // (undocumented) getAllOutput(sparse: true, options?: IStringBufferOutputOptions): Partial; @@ -389,7 +422,7 @@ export class StringBufferTerminalProvider implements ITerminalProvider { getVerboseOutput(options?: IStringBufferOutputOptions): string; getWarningOutput(options?: IStringBufferOutputOptions): string; readonly supportsColor: boolean; - write(data: string, severity: TerminalProviderSeverity): void; + write(text: string, severity: TerminalProviderSeverity): void; } // @beta @@ -429,6 +462,9 @@ export enum TerminalProviderSeverity { warning = 1 } +// @beta (undocumented) +export type TerminalProviderSeverityName = keyof typeof TerminalProviderSeverity; + // @beta export class TerminalStreamWritable extends Writable { constructor(options: ITerminalStreamWritableOptions); diff --git a/libraries/terminal/src/StringBufferTerminalProvider.ts b/libraries/terminal/src/StringBufferTerminalProvider.ts index 9f6d83bb0c..07af24365c 100644 --- a/libraries/terminal/src/StringBufferTerminalProvider.ts +++ b/libraries/terminal/src/StringBufferTerminalProvider.ts @@ -16,7 +16,22 @@ export interface IStringBufferOutputOptions { * * This option defaults to `true` */ - normalizeSpecialCharacters: boolean; + normalizeSpecialCharacters?: boolean; +} + +/** + * @beta + */ +export interface IStringBufferOutputChunksOptions extends IStringBufferOutputOptions { + /** + * If true, the severity levels will be represented as names instead of as enum values. + */ + severityAsNames?: boolean; + + /** + * If true, the output chunks will be returned as a flat array of prefixed strings of an array of objects. + */ + asFlat?: boolean; } /** @@ -30,6 +45,19 @@ export interface IAllStringBufferOutput { debug: string; } +/** + * @beta + */ +export type TerminalProviderSeverityName = keyof typeof TerminalProviderSeverity; + +/** + * @beta + */ +export interface IOutputChunk { + text: string; + severity: TSeverity; +} + function _normalizeOutput(s: string, options: IStringBufferOutputOptions | undefined): string { options = { normalizeSpecialCharacters: true, @@ -46,6 +74,10 @@ function _normalizeOutput(s: string, options: IStringBufferOutputOptions | undef } } +const LONGEST_SEVERITY_NAME_LENGTH: number = Math.max( + ...Object.keys(TerminalProviderSeverity).map(({ length }) => length) +); + /** * Terminal provider that stores written data in buffers separated by severity. * This terminal provider is designed to be used when code that prints to a terminal @@ -59,6 +91,7 @@ export class StringBufferTerminalProvider implements ITerminalProvider { private _debugBuffer: StringBuilder = new StringBuilder(); private _warningBuffer: StringBuilder = new StringBuilder(); private _errorBuffer: StringBuilder = new StringBuilder(); + private _allOutputChunks: IOutputChunk[] = []; /** * {@inheritDoc ITerminalProvider.supportsColor} @@ -72,31 +105,33 @@ export class StringBufferTerminalProvider implements ITerminalProvider { /** * {@inheritDoc ITerminalProvider.write} */ - public write(data: string, severity: TerminalProviderSeverity): void { + public write(text: string, severity: TerminalProviderSeverity): void { + this._allOutputChunks.push({ text, severity }); + switch (severity) { case TerminalProviderSeverity.warning: { - this._warningBuffer.append(data); + this._warningBuffer.append(text); break; } case TerminalProviderSeverity.error: { - this._errorBuffer.append(data); + this._errorBuffer.append(text); break; } case TerminalProviderSeverity.verbose: { - this._verboseBuffer.append(data); + this._verboseBuffer.append(text); break; } case TerminalProviderSeverity.debug: { - this._debugBuffer.append(data); + this._debugBuffer.append(text); break; } case TerminalProviderSeverity.log: default: { - this._standardBuffer.append(data); + this._standardBuffer.append(text); break; } } @@ -189,4 +224,60 @@ export class StringBufferTerminalProvider implements ITerminalProvider { return result; } + + /** + * Get everything that has been written as an array of output chunks, preserving order. + */ + public getAllOutputAsChunks( + options?: IStringBufferOutputChunksOptions & { severityAsNames?: false; asFlat?: false } + ): IOutputChunk[]; + public getAllOutputAsChunks( + options: IStringBufferOutputChunksOptions & { severityAsNames: true; asFlat?: false } + ): IOutputChunk[]; + public getAllOutputAsChunks( + options?: IStringBufferOutputChunksOptions & { severityAsNames?: false; asFlat: true } + ): `[${TerminalProviderSeverity}] ${string}`[]; + public getAllOutputAsChunks( + options: IStringBufferOutputChunksOptions & { severityAsNames: true; asFlat: true } + ): `[${string}] ${string}`[]; + public getAllOutputAsChunks( + options: IStringBufferOutputChunksOptions = {} + ): IOutputChunk[] | string[] { + const { asFlat, severityAsNames } = options; + + function getNormalizedSeverity( + rawSeverity: TerminalProviderSeverity + ): TerminalProviderSeverity | TerminalProviderSeverityName { + if (severityAsNames) { + return TerminalProviderSeverity[rawSeverity] as TerminalProviderSeverityName; + } else { + return rawSeverity; + } + } + + if (asFlat) { + return this._allOutputChunks.map(({ text: rawText, severity: rawSeverity }) => { + const severity: TerminalProviderSeverity | `${string}${TerminalProviderSeverityName}` = + getNormalizedSeverity(rawSeverity); + const text: string = _normalizeOutput(rawText, options); + + const paddedSeverity: TerminalProviderSeverity | string = severityAsNames + ? (severity as TerminalProviderSeverityName).padStart(LONGEST_SEVERITY_NAME_LENGTH, ' ') + : severity; + + return `[${paddedSeverity}] ${text}`; + }); + } else { + return this._allOutputChunks.map(({ text: rawText, severity: rawSeverity }) => { + const severity: TerminalProviderSeverity | TerminalProviderSeverityName = + getNormalizedSeverity(rawSeverity); + const text: string = _normalizeOutput(rawText, options); + + return { + text, + severity + }; + }); + } + } } diff --git a/libraries/terminal/src/index.ts b/libraries/terminal/src/index.ts index 2254e40b9f..cbea552b49 100644 --- a/libraries/terminal/src/index.ts +++ b/libraries/terminal/src/index.ts @@ -40,7 +40,10 @@ export { ConsoleTerminalProvider, type IConsoleTerminalProviderOptions } from '. export { StringBufferTerminalProvider, type IStringBufferOutputOptions, - type IAllStringBufferOutput + type IAllStringBufferOutput, + type IOutputChunk, + type IStringBufferOutputChunksOptions, + type TerminalProviderSeverityName } from './StringBufferTerminalProvider'; export { PrefixProxyTerminalProvider, From 2cbd50e233fd07e202ec1cfbd6c08af09e6eed02 Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Sat, 3 Jan 2026 19:40:42 -0500 Subject: [PATCH 02/14] fixup! Add a StringBufferTerminalProvider.getAllOutputAsChunks function that returns an array of chunks that were written to the terminal provider. --- common/reviews/api/terminal.api.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/reviews/api/terminal.api.md b/common/reviews/api/terminal.api.md index b895e6927b..7de496f099 100644 --- a/common/reviews/api/terminal.api.md +++ b/common/reviews/api/terminal.api.md @@ -392,6 +392,9 @@ export class StdioWritable extends TerminalWritable { export class StringBufferTerminalProvider implements ITerminalProvider { constructor(supportsColor?: boolean); get eolCharacter(): string; + getAllOutput(sparse?: false, options?: IStringBufferOutputOptions): IAllStringBufferOutput; + // (undocumented) + getAllOutput(sparse: true, options?: IStringBufferOutputOptions): Partial; getAllOutputAsChunks(options?: IStringBufferOutputChunksOptions & { severityAsNames?: false; asFlat?: false; @@ -411,9 +414,6 @@ export class StringBufferTerminalProvider implements ITerminalProvider { severityAsNames: true; asFlat: true; }): `[${string}] ${string}`[]; - getAllOutput(sparse?: false, options?: IStringBufferOutputOptions): IAllStringBufferOutput; - // (undocumented) - getAllOutput(sparse: true, options?: IStringBufferOutputOptions): Partial; getDebugOutput(options?: IStringBufferOutputOptions): string; getErrorOutput(options?: IStringBufferOutputOptions): string; getOutput(options?: IStringBufferOutputOptions): string; From 613035d94a521b8915a52265be4f505872ded5d4 Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Sat, 3 Jan 2026 21:59:35 -0500 Subject: [PATCH 03/14] Update tests to use StringBufferTerminalProvider.getAllOutputAsChunks. --- .../rush/main_2026-01-04-02-58.json | 10 + .../main_2026-01-04-02-58.json | 10 + .../main_2026-01-04-02-58.json | 10 + .../main_2026-01-04-02-58.json | 10 + .../src/test/ConfigurationFile.test.ts | 2 +- .../ConfigurationFile.test.ts.snap | 208 ++-- .../test/__snapshots__/parseResx.test.ts.snap | 32 +- .../src/parsers/test/parseResx.test.ts | 4 +- .../test/OperationExecutionManager.test.ts | 36 +- .../OperationExecutionManager.test.ts.snap | 54 +- .../api/test/CustomTipsConfiguration.test.ts | 19 +- .../api/test/RushProjectConfiguration.test.ts | 8 +- .../CustomTipsConfiguration.test.ts.snap | 653 ++++++------ .../RushProjectConfiguration.test.ts.snap | 28 +- .../operations/test/BuildPlanPlugin.test.ts | 6 +- .../test/OperationMetadataManager.test.ts | 14 +- .../BuildPlanPlugin.test.ts.snap | 797 ++++++++++----- .../OperationMetadataManager.test.ts.snap | 22 +- .../pnpm/test/PnpmShrinkwrapFile.test.ts | 4 +- .../PnpmShrinkwrapFile.test.ts.snap | 6 +- .../src/logic/test/InstallHelpers.test.ts | 10 +- .../test/ProjectImpactGraphGenerator.test.ts | 10 +- .../__snapshots__/InstallHelpers.test.ts.snap | 2 +- .../ProjectImpactGraphGenerator.test.ts.snap | 23 +- .../test/PrefixProxyTerminalProvider.test.ts | 5 +- libraries/terminal/src/test/Terminal.test.ts | 3 +- .../src/test/TerminalStreamWritable.test.ts | 3 +- .../PrefixProxyTerminalProvider.test.ts.snap | 202 +++- .../test/__snapshots__/Terminal.test.ts.snap | 956 ++++++++++++++++-- .../TerminalStreamWritable.test.ts.snap | 55 +- .../src/test/HttpBuildCacheProvider.test.ts | 42 +- 31 files changed, 2270 insertions(+), 974 deletions(-) create mode 100644 common/changes/@microsoft/rush/main_2026-01-04-02-58.json create mode 100644 common/changes/@rushstack/heft-config-file/main_2026-01-04-02-58.json create mode 100644 common/changes/@rushstack/localization-utilities/main_2026-01-04-02-58.json create mode 100644 common/changes/@rushstack/operation-graph/main_2026-01-04-02-58.json diff --git a/common/changes/@microsoft/rush/main_2026-01-04-02-58.json b/common/changes/@microsoft/rush/main_2026-01-04-02-58.json new file mode 100644 index 0000000000..bd7ff97cb3 --- /dev/null +++ b/common/changes/@microsoft/rush/main_2026-01-04-02-58.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@microsoft/rush", + "comment": "", + "type": "none" + } + ], + "packageName": "@microsoft/rush" +} \ No newline at end of file diff --git a/common/changes/@rushstack/heft-config-file/main_2026-01-04-02-58.json b/common/changes/@rushstack/heft-config-file/main_2026-01-04-02-58.json new file mode 100644 index 0000000000..9b24a4fdcc --- /dev/null +++ b/common/changes/@rushstack/heft-config-file/main_2026-01-04-02-58.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@rushstack/heft-config-file", + "comment": "", + "type": "none" + } + ], + "packageName": "@rushstack/heft-config-file" +} \ No newline at end of file diff --git a/common/changes/@rushstack/localization-utilities/main_2026-01-04-02-58.json b/common/changes/@rushstack/localization-utilities/main_2026-01-04-02-58.json new file mode 100644 index 0000000000..3830d7f42e --- /dev/null +++ b/common/changes/@rushstack/localization-utilities/main_2026-01-04-02-58.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@rushstack/localization-utilities", + "comment": "", + "type": "none" + } + ], + "packageName": "@rushstack/localization-utilities" +} \ No newline at end of file diff --git a/common/changes/@rushstack/operation-graph/main_2026-01-04-02-58.json b/common/changes/@rushstack/operation-graph/main_2026-01-04-02-58.json new file mode 100644 index 0000000000..eabefe94ed --- /dev/null +++ b/common/changes/@rushstack/operation-graph/main_2026-01-04-02-58.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@rushstack/operation-graph", + "comment": "", + "type": "none" + } + ], + "packageName": "@rushstack/operation-graph" +} \ No newline at end of file diff --git a/libraries/heft-config-file/src/test/ConfigurationFile.test.ts b/libraries/heft-config-file/src/test/ConfigurationFile.test.ts index 27bb1965dc..121bfb36a7 100644 --- a/libraries/heft-config-file/src/test/ConfigurationFile.test.ts +++ b/libraries/heft-config-file/src/test/ConfigurationFile.test.ts @@ -26,7 +26,7 @@ describe('ConfigurationFile', () => { }); afterEach(() => { - expect(terminalProvider.getAllOutput(true)).toMatchSnapshot(); + expect(terminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true })).toMatchSnapshot(); }); describe('A simple config file', () => { diff --git a/libraries/heft-config-file/src/test/__snapshots__/ConfigurationFile.test.ts.snap b/libraries/heft-config-file/src/test/__snapshots__/ConfigurationFile.test.ts.snap index a9fe0cb92b..5c90062d35 100644 --- a/libraries/heft-config-file/src/test/__snapshots__/ConfigurationFile.test.ts.snap +++ b/libraries/heft-config-file/src/test/__snapshots__/ConfigurationFile.test.ts.snap @@ -1,128 +1,128 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`ConfigurationFile A complex config file Can get the original $schema property value 1`] = `Object {}`; +exports[`ConfigurationFile A complex config file Can get the original $schema property value 1`] = `Array []`; -exports[`ConfigurationFile A complex config file Correctly loads a complex config file (Deprecated PathResolutionMethod.NodeResolve) 1`] = `Object {}`; +exports[`ConfigurationFile A complex config file Correctly loads a complex config file (Deprecated PathResolutionMethod.NodeResolve) 1`] = `Array []`; -exports[`ConfigurationFile A complex config file Correctly loads a complex config file 1`] = `Object {}`; +exports[`ConfigurationFile A complex config file Correctly loads a complex config file 1`] = `Array []`; -exports[`ConfigurationFile A complex config file Correctly loads a complex config file async (Deprecated PathResolutionMethod.NodeResolve) 1`] = `Object {}`; +exports[`ConfigurationFile A complex config file Correctly loads a complex config file async (Deprecated PathResolutionMethod.NodeResolve) 1`] = `Array []`; -exports[`ConfigurationFile A complex config file Correctly loads a complex config file async 1`] = `Object {}`; +exports[`ConfigurationFile A complex config file Correctly loads a complex config file async 1`] = `Array []`; -exports[`ConfigurationFile A simple config file containing an array and an object Correctly loads the config file 1`] = `Object {}`; +exports[`ConfigurationFile A simple config file containing an array and an object Correctly loads the config file 1`] = `Array []`; -exports[`ConfigurationFile A simple config file containing an array and an object Correctly loads the config file async 1`] = `Object {}`; +exports[`ConfigurationFile A simple config file containing an array and an object Correctly loads the config file async 1`] = `Array []`; -exports[`ConfigurationFile A simple config file containing an array and an object Correctly resolves paths relative to the config file 1`] = `Object {}`; +exports[`ConfigurationFile A simple config file containing an array and an object Correctly resolves paths relative to the config file 1`] = `Array []`; -exports[`ConfigurationFile A simple config file containing an array and an object Correctly resolves paths relative to the config file async 1`] = `Object {}`; +exports[`ConfigurationFile A simple config file containing an array and an object Correctly resolves paths relative to the config file async 1`] = `Array []`; -exports[`ConfigurationFile A simple config file containing an array and an object Correctly resolves paths relative to the project root 1`] = `Object {}`; +exports[`ConfigurationFile A simple config file containing an array and an object Correctly resolves paths relative to the project root 1`] = `Array []`; -exports[`ConfigurationFile A simple config file containing an array and an object Correctly resolves paths relative to the project root async 1`] = `Object {}`; +exports[`ConfigurationFile A simple config file containing an array and an object Correctly resolves paths relative to the project root async 1`] = `Array []`; -exports[`ConfigurationFile A simple config file with "extends" Correctly loads the config file with "append" and "merge" in config meta 1`] = `Object {}`; +exports[`ConfigurationFile A simple config file with "extends" Correctly loads the config file with "append" and "merge" in config meta 1`] = `Array []`; -exports[`ConfigurationFile A simple config file with "extends" Correctly loads the config file with "append" and "merge" in config meta async 1`] = `Object {}`; +exports[`ConfigurationFile A simple config file with "extends" Correctly loads the config file with "append" and "merge" in config meta async 1`] = `Array []`; -exports[`ConfigurationFile A simple config file with "extends" Correctly loads the config file with "custom" in config meta 1`] = `Object {}`; +exports[`ConfigurationFile A simple config file with "extends" Correctly loads the config file with "custom" in config meta 1`] = `Array []`; -exports[`ConfigurationFile A simple config file with "extends" Correctly loads the config file with "custom" in config meta async 1`] = `Object {}`; +exports[`ConfigurationFile A simple config file with "extends" Correctly loads the config file with "custom" in config meta async 1`] = `Array []`; -exports[`ConfigurationFile A simple config file with "extends" Correctly loads the config file with "replace" in config meta 1`] = `Object {}`; +exports[`ConfigurationFile A simple config file with "extends" Correctly loads the config file with "replace" in config meta 1`] = `Array []`; -exports[`ConfigurationFile A simple config file with "extends" Correctly loads the config file with "replace" in config meta async 1`] = `Object {}`; +exports[`ConfigurationFile A simple config file with "extends" Correctly loads the config file with "replace" in config meta async 1`] = `Array []`; -exports[`ConfigurationFile A simple config file with "extends" Correctly loads the config file with default config meta 1`] = `Object {}`; +exports[`ConfigurationFile A simple config file with "extends" Correctly loads the config file with default config meta 1`] = `Array []`; -exports[`ConfigurationFile A simple config file with "extends" Correctly loads the config file with default config meta async 1`] = `Object {}`; +exports[`ConfigurationFile A simple config file with "extends" Correctly loads the config file with default config meta async 1`] = `Array []`; -exports[`ConfigurationFile A simple config file with "extends" Correctly loads the config file with modified merge behaviors for arrays and objects 1`] = `Object {}`; +exports[`ConfigurationFile A simple config file with "extends" Correctly loads the config file with modified merge behaviors for arrays and objects 1`] = `Array []`; -exports[`ConfigurationFile A simple config file with "extends" Correctly loads the config file with modified merge behaviors for arrays and objects async 1`] = `Object {}`; +exports[`ConfigurationFile A simple config file with "extends" Correctly loads the config file with modified merge behaviors for arrays and objects async 1`] = `Array []`; -exports[`ConfigurationFile A simple config file with "extends" Correctly resolves paths relative to the config file 1`] = `Object {}`; +exports[`ConfigurationFile A simple config file with "extends" Correctly resolves paths relative to the config file 1`] = `Array []`; -exports[`ConfigurationFile A simple config file with "extends" Correctly resolves paths relative to the config file async 1`] = `Object {}`; +exports[`ConfigurationFile A simple config file with "extends" Correctly resolves paths relative to the config file async 1`] = `Array []`; -exports[`ConfigurationFile A simple config file with a JSON schema object Correctly loads the config file 1`] = `Object {}`; +exports[`ConfigurationFile A simple config file with a JSON schema object Correctly loads the config file 1`] = `Array []`; -exports[`ConfigurationFile A simple config file with a JSON schema object Correctly loads the config file async 1`] = `Object {}`; +exports[`ConfigurationFile A simple config file with a JSON schema object Correctly loads the config file async 1`] = `Array []`; -exports[`ConfigurationFile A simple config file with a JSON schema object Correctly resolves paths relative to the config file 1`] = `Object {}`; +exports[`ConfigurationFile A simple config file with a JSON schema object Correctly resolves paths relative to the config file 1`] = `Array []`; -exports[`ConfigurationFile A simple config file with a JSON schema object Correctly resolves paths relative to the config file async 1`] = `Object {}`; +exports[`ConfigurationFile A simple config file with a JSON schema object Correctly resolves paths relative to the config file async 1`] = `Array []`; -exports[`ConfigurationFile A simple config file with a JSON schema object Correctly resolves paths relative to the project root 1`] = `Object {}`; +exports[`ConfigurationFile A simple config file with a JSON schema object Correctly resolves paths relative to the project root 1`] = `Array []`; -exports[`ConfigurationFile A simple config file with a JSON schema object Correctly resolves paths relative to the project root async 1`] = `Object {}`; +exports[`ConfigurationFile A simple config file with a JSON schema object Correctly resolves paths relative to the project root async 1`] = `Array []`; -exports[`ConfigurationFile A simple config file with a JSON schema object The NonProjectConfigurationFile version works correctly 1`] = `Object {}`; +exports[`ConfigurationFile A simple config file with a JSON schema object The NonProjectConfigurationFile version works correctly 1`] = `Array []`; -exports[`ConfigurationFile A simple config file with a JSON schema object The NonProjectConfigurationFile version works correctly async 1`] = `Object {}`; +exports[`ConfigurationFile A simple config file with a JSON schema object The NonProjectConfigurationFile version works correctly async 1`] = `Array []`; -exports[`ConfigurationFile A simple config file with a JSON schema path Correctly loads the config file 1`] = `Object {}`; +exports[`ConfigurationFile A simple config file with a JSON schema path Correctly loads the config file 1`] = `Array []`; -exports[`ConfigurationFile A simple config file with a JSON schema path Correctly loads the config file async 1`] = `Object {}`; +exports[`ConfigurationFile A simple config file with a JSON schema path Correctly loads the config file async 1`] = `Array []`; -exports[`ConfigurationFile A simple config file with a JSON schema path Correctly resolves paths relative to the config file 1`] = `Object {}`; +exports[`ConfigurationFile A simple config file with a JSON schema path Correctly resolves paths relative to the config file 1`] = `Array []`; -exports[`ConfigurationFile A simple config file with a JSON schema path Correctly resolves paths relative to the config file async 1`] = `Object {}`; +exports[`ConfigurationFile A simple config file with a JSON schema path Correctly resolves paths relative to the config file async 1`] = `Array []`; -exports[`ConfigurationFile A simple config file with a JSON schema path Correctly resolves paths relative to the project root 1`] = `Object {}`; +exports[`ConfigurationFile A simple config file with a JSON schema path Correctly resolves paths relative to the project root 1`] = `Array []`; -exports[`ConfigurationFile A simple config file with a JSON schema path Correctly resolves paths relative to the project root async 1`] = `Object {}`; +exports[`ConfigurationFile A simple config file with a JSON schema path Correctly resolves paths relative to the project root async 1`] = `Array []`; -exports[`ConfigurationFile A simple config file with a JSON schema path The NonProjectConfigurationFile version works correctly 1`] = `Object {}`; +exports[`ConfigurationFile A simple config file with a JSON schema path The NonProjectConfigurationFile version works correctly 1`] = `Array []`; -exports[`ConfigurationFile A simple config file with a JSON schema path The NonProjectConfigurationFile version works correctly async 1`] = `Object {}`; +exports[`ConfigurationFile A simple config file with a JSON schema path The NonProjectConfigurationFile version works correctly async 1`] = `Array []`; -exports[`ConfigurationFile a complex file with inheritance type annotations Correctly loads a complex config file with a single inheritance type annotation 1`] = `Object {}`; +exports[`ConfigurationFile a complex file with inheritance type annotations Correctly loads a complex config file with a single inheritance type annotation 1`] = `Array []`; -exports[`ConfigurationFile a complex file with inheritance type annotations Correctly loads a complex config file with inheritance type annotations 1`] = `Object {}`; +exports[`ConfigurationFile a complex file with inheritance type annotations Correctly loads a complex config file with inheritance type annotations 1`] = `Array []`; -exports[`ConfigurationFile a complex file with inheritance type annotations Correctly loads a complex config file with inheritance type annotations async 1`] = `Object {}`; +exports[`ConfigurationFile a complex file with inheritance type annotations Correctly loads a complex config file with inheritance type annotations async 1`] = `Array []`; exports[`ConfigurationFile a complex file with inheritance type annotations throws an error when a keyed object uses the 'append' inheritance type 1`] = `"Issue in processing configuration file property \\"c\\". Property is not an array, but the inheritance type is set as \\"append\\""`; -exports[`ConfigurationFile a complex file with inheritance type annotations throws an error when a keyed object uses the 'append' inheritance type 2`] = `Object {}`; +exports[`ConfigurationFile a complex file with inheritance type annotations throws an error when a keyed object uses the 'append' inheritance type 2`] = `Array []`; exports[`ConfigurationFile a complex file with inheritance type annotations throws an error when a keyed object uses the 'append' inheritance type async 1`] = `"Issue in processing configuration file property \\"c\\". Property is not an array, but the inheritance type is set as \\"append\\""`; -exports[`ConfigurationFile a complex file with inheritance type annotations throws an error when a keyed object uses the 'append' inheritance type async 2`] = `Object {}`; +exports[`ConfigurationFile a complex file with inheritance type annotations throws an error when a keyed object uses the 'append' inheritance type async 2`] = `Array []`; exports[`ConfigurationFile a complex file with inheritance type annotations throws an error when a non-object property uses an inheritance type 1`] = `"Issue in processing configuration file property \\"$l.inheritanceType\\". An inheritance type was provided for a property that is not a keyed object or array."`; -exports[`ConfigurationFile a complex file with inheritance type annotations throws an error when a non-object property uses an inheritance type 2`] = `Object {}`; +exports[`ConfigurationFile a complex file with inheritance type annotations throws an error when a non-object property uses an inheritance type 2`] = `Array []`; exports[`ConfigurationFile a complex file with inheritance type annotations throws an error when a non-object property uses an inheritance type async 1`] = `"Issue in processing configuration file property \\"$l.inheritanceType\\". An inheritance type was provided for a property that is not a keyed object or array."`; -exports[`ConfigurationFile a complex file with inheritance type annotations throws an error when a non-object property uses an inheritance type async 2`] = `Object {}`; +exports[`ConfigurationFile a complex file with inheritance type annotations throws an error when a non-object property uses an inheritance type async 2`] = `Array []`; exports[`ConfigurationFile a complex file with inheritance type annotations throws an error when an array uses the 'merge' inheritance type 1`] = `"Issue in processing configuration file property \\"a\\". Property is not a keyed object, but the inheritance type is set as \\"merge\\""`; -exports[`ConfigurationFile a complex file with inheritance type annotations throws an error when an array uses the 'merge' inheritance type 2`] = `Object {}`; +exports[`ConfigurationFile a complex file with inheritance type annotations throws an error when an array uses the 'merge' inheritance type 2`] = `Array []`; exports[`ConfigurationFile a complex file with inheritance type annotations throws an error when an array uses the 'merge' inheritance type async 1`] = `"Issue in processing configuration file property \\"a\\". Property is not a keyed object, but the inheritance type is set as \\"merge\\""`; -exports[`ConfigurationFile a complex file with inheritance type annotations throws an error when an array uses the 'merge' inheritance type async 2`] = `Object {}`; +exports[`ConfigurationFile a complex file with inheritance type annotations throws an error when an array uses the 'merge' inheritance type async 2`] = `Array []`; exports[`ConfigurationFile a complex file with inheritance type annotations throws an error when an inheritance type is specified for an unspecified property 1`] = `"Issue in processing configuration file property \\"$c.inheritanceType\\". An inheritance type was provided but no matching property was found in the parent."`; -exports[`ConfigurationFile a complex file with inheritance type annotations throws an error when an inheritance type is specified for an unspecified property 2`] = `Object {}`; +exports[`ConfigurationFile a complex file with inheritance type annotations throws an error when an inheritance type is specified for an unspecified property 2`] = `Array []`; exports[`ConfigurationFile a complex file with inheritance type annotations throws an error when an inheritance type is specified for an unspecified property async 1`] = `"Issue in processing configuration file property \\"$c.inheritanceType\\". An inheritance type was provided but no matching property was found in the parent."`; -exports[`ConfigurationFile a complex file with inheritance type annotations throws an error when an inheritance type is specified for an unspecified property async 2`] = `Object {}`; +exports[`ConfigurationFile a complex file with inheritance type annotations throws an error when an inheritance type is specified for an unspecified property async 2`] = `Array []`; exports[`ConfigurationFile a complex file with inheritance type annotations throws an error when an unsupported inheritance type is specified 1`] = `"Issue in processing configuration file property \\"$a.inheritanceType\\". An unsupported inheritance type was provided: \\"custom\\""`; -exports[`ConfigurationFile a complex file with inheritance type annotations throws an error when an unsupported inheritance type is specified 2`] = `Object {}`; +exports[`ConfigurationFile a complex file with inheritance type annotations throws an error when an unsupported inheritance type is specified 2`] = `Array []`; exports[`ConfigurationFile a complex file with inheritance type annotations throws an error when an unsupported inheritance type is specified async 1`] = `"Issue in processing configuration file property \\"$a.inheritanceType\\". An unsupported inheritance type was provided: \\"custom\\""`; -exports[`ConfigurationFile a complex file with inheritance type annotations throws an error when an unsupported inheritance type is specified async 2`] = `Object {}`; +exports[`ConfigurationFile a complex file with inheritance type annotations throws an error when an unsupported inheritance type is specified async 2`] = `Array []`; exports[`ConfigurationFile error cases Throws an error for a file that doesn't match its schema 1`] = ` "Resolved configuration object does not match schema: Error: JSON validation failed: @@ -132,7 +132,7 @@ Error: #/filePaths must be array" `; -exports[`ConfigurationFile error cases Throws an error for a file that doesn't match its schema 2`] = `Object {}`; +exports[`ConfigurationFile error cases Throws an error for a file that doesn't match its schema 2`] = `Array []`; exports[`ConfigurationFile error cases Throws an error for a file that doesn't match its schema async 1`] = ` "Resolved configuration object does not match schema: Error: JSON validation failed: @@ -142,7 +142,7 @@ Error: #/filePaths must be array" `; -exports[`ConfigurationFile error cases Throws an error for a file that doesn't match its schema async 2`] = `Object {}`; +exports[`ConfigurationFile error cases Throws an error for a file that doesn't match its schema async 2`] = `Array []`; exports[`ConfigurationFile error cases Throws an error when a combined config file doesn't match the schema 1`] = ` "Resolved configuration object does not match schema: Error: JSON validation failed: @@ -156,7 +156,7 @@ Error: # must match exactly one schema in oneOf" `; -exports[`ConfigurationFile error cases Throws an error when a combined config file doesn't match the schema 2`] = `Object {}`; +exports[`ConfigurationFile error cases Throws an error when a combined config file doesn't match the schema 2`] = `Array []`; exports[`ConfigurationFile error cases Throws an error when a combined config file doesn't match the schema async 1`] = ` "Resolved configuration object does not match schema: Error: JSON validation failed: @@ -170,116 +170,120 @@ Error: # must match exactly one schema in oneOf" `; -exports[`ConfigurationFile error cases Throws an error when a combined config file doesn't match the schema async 2`] = `Object {}`; +exports[`ConfigurationFile error cases Throws an error when a combined config file doesn't match the schema async 2`] = `Array []`; exports[`ConfigurationFile error cases Throws an error when a requested file doesn't exist 1`] = `"File does not exist: /lib/test/errorCases/folderThatDoesntExist/config.json"`; exports[`ConfigurationFile error cases Throws an error when a requested file doesn't exist 2`] = ` -Object { - "debug": "Configuration file \\"/lib/test/errorCases/folderThatDoesntExist/config.json\\" not found.[n]", -} +Array [ + "[ debug] Configuration file \\"/lib/test/errorCases/folderThatDoesntExist/config.json\\" not found.[n]", +] `; exports[`ConfigurationFile error cases Throws an error when a requested file doesn't exist async 1`] = `"File does not exist: /lib/test/errorCases/folderThatDoesntExist/config.json"`; exports[`ConfigurationFile error cases Throws an error when a requested file doesn't exist async 2`] = ` -Object { - "debug": "Configuration file \\"/lib/test/errorCases/folderThatDoesntExist/config.json\\" not found.[n]", -} +Array [ + "[ debug] Configuration file \\"/lib/test/errorCases/folderThatDoesntExist/config.json\\" not found.[n]", +] `; exports[`ConfigurationFile error cases Throws an error when an "extends" property points to a file that cannot be resolved 1`] = `"In file \\"/lib/test/errorCases/extendsNotExist/config.json\\", file referenced in \\"extends\\" property (\\"./config2.json\\") cannot be resolved."`; exports[`ConfigurationFile error cases Throws an error when an "extends" property points to a file that cannot be resolved 2`] = ` -Object { - "debug": "Configuration file \\"/lib/test/errorCases/extendsNotExist/config2.json\\" not found.[n]", -} +Array [ + "[ debug] Configuration file \\"/lib/test/errorCases/extendsNotExist/config2.json\\" not found.[n]", +] `; exports[`ConfigurationFile error cases Throws an error when an "extends" property points to a file that cannot be resolved async 1`] = `"In file \\"/lib/test/errorCases/extendsNotExist/config.json\\", file referenced in \\"extends\\" property (\\"./config2.json\\") cannot be resolved."`; exports[`ConfigurationFile error cases Throws an error when an "extends" property points to a file that cannot be resolved async 2`] = ` -Object { - "debug": "Configuration file \\"/lib/test/errorCases/extendsNotExist/config2.json\\" not found.[n]", -} +Array [ + "[ debug] Configuration file \\"/lib/test/errorCases/extendsNotExist/config2.json\\" not found.[n]", +] `; -exports[`ConfigurationFile error cases Throws an error when the file isn't valid JSON 1`] = `Object {}`; +exports[`ConfigurationFile error cases Throws an error when the file isn't valid JSON 1`] = `Array []`; -exports[`ConfigurationFile error cases Throws an error when the file isn't valid JSON async 1`] = `Object {}`; +exports[`ConfigurationFile error cases Throws an error when the file isn't valid JSON async 1`] = `Array []`; exports[`ConfigurationFile error cases Throws an error when there is a circular reference in "extends" properties 1`] = `"A loop has been detected in the \\"extends\\" properties of configuration file at \\"/lib/test/errorCases/circularReference/config1.json\\"."`; -exports[`ConfigurationFile error cases Throws an error when there is a circular reference in "extends" properties 2`] = `Object {}`; +exports[`ConfigurationFile error cases Throws an error when there is a circular reference in "extends" properties 2`] = `Array []`; exports[`ConfigurationFile error cases Throws an error when there is a circular reference in "extends" properties async 1`] = `"A loop has been detected in the \\"extends\\" properties of configuration file at \\"/lib/test/errorCases/circularReference/config1.json\\"."`; -exports[`ConfigurationFile error cases Throws an error when there is a circular reference in "extends" properties async 2`] = `Object {}`; +exports[`ConfigurationFile error cases Throws an error when there is a circular reference in "extends" properties async 2`] = `Array []`; exports[`ConfigurationFile error cases returns undefined when the file doesn't exist for tryLoadConfigurationFileForProject 1`] = ` -Object { - "debug": "Configuration file \\"/lib/test/errorCases/invalidType/notExist.json\\" not found.[n]", -} +Array [ + "[ debug] Configuration file \\"/lib/test/errorCases/invalidType/notExist.json\\" not found.[n]", +] `; exports[`ConfigurationFile error cases returns undefined when the file doesn't exist for tryLoadConfigurationFileForProjectAsync 1`] = ` -Object { - "debug": "Configuration file \\"/lib/test/errorCases/invalidType/notExist.json\\" not found.[n]", -} +Array [ + "[ debug] Configuration file \\"/lib/test/errorCases/invalidType/notExist.json\\" not found.[n]", +] `; exports[`ConfigurationFile error cases throws an error when the file doesn't exist 1`] = `"File does not exist: /lib/test/errorCases/invalidType/notExist.json"`; exports[`ConfigurationFile error cases throws an error when the file doesn't exist 2`] = ` -Object { - "debug": "Configuration file \\"/lib/test/errorCases/invalidType/notExist.json\\" not found.[n]", -} +Array [ + "[ debug] Configuration file \\"/lib/test/errorCases/invalidType/notExist.json\\" not found.[n]", +] `; exports[`ConfigurationFile error cases throws an error when the file doesn't exist async 1`] = `"File does not exist: /lib/test/errorCases/invalidType/notExist.json"`; exports[`ConfigurationFile error cases throws an error when the file doesn't exist async 2`] = ` -Object { - "debug": "Configuration file \\"/lib/test/errorCases/invalidType/notExist.json\\" not found.[n]", -} +Array [ + "[ debug] Configuration file \\"/lib/test/errorCases/invalidType/notExist.json\\" not found.[n]", +] `; exports[`ConfigurationFile loading a rig correctly loads a config file inside a rig 1`] = ` -Object { - "debug": "Configuration file \\"/lib/test/project-referencing-rig/config/simplestConfigFile.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").[n]", -} +Array [ + "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/simplestConfigFile.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").[n]", +] `; exports[`ConfigurationFile loading a rig correctly loads a config file inside a rig async 1`] = ` -Object { - "debug": "Configuration file \\"/lib/test/project-referencing-rig/config/simplestConfigFile.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").[n]", -} +Array [ + "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/simplestConfigFile.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").[n]", +] `; exports[`ConfigurationFile loading a rig correctly loads a config file inside a rig via tryLoadConfigurationFileForProject 1`] = ` -Object { - "debug": "Configuration file \\"/lib/test/project-referencing-rig/config/simplestConfigFile.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").[n]", -} +Array [ + "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/simplestConfigFile.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").[n]", +] `; exports[`ConfigurationFile loading a rig correctly loads a config file inside a rig via tryLoadConfigurationFileForProjectAsync 1`] = ` -Object { - "debug": "Configuration file \\"/lib/test/project-referencing-rig/config/simplestConfigFile.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").[n]", -} +Array [ + "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/simplestConfigFile.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").[n]", +] `; exports[`ConfigurationFile loading a rig throws an error when a config file doesn't exist in a project referencing a rig, which also doesn't have the file 1`] = `"File does not exist: /lib/test/project-referencing-rig/config/notExist.json"`; exports[`ConfigurationFile loading a rig throws an error when a config file doesn't exist in a project referencing a rig, which also doesn't have the file 2`] = ` -Object { - "debug": "Configuration file \\"/lib/test/project-referencing-rig/config/notExist.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").[n]Configuration file \\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default/config/notExist.json\\" not found.[n]Configuration file \\"/lib/test/project-referencing-rig/config/notExist.json\\" not found.[n]", -} +Array [ + "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/notExist.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").[n]", + "[ debug] Configuration file \\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default/config/notExist.json\\" not found.[n]", + "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/notExist.json\\" not found.[n]", +] `; exports[`ConfigurationFile loading a rig throws an error when a config file doesn't exist in a project referencing a rig, which also doesn't have the file async 1`] = `"File does not exist: /lib/test/project-referencing-rig/config/notExist.json"`; exports[`ConfigurationFile loading a rig throws an error when a config file doesn't exist in a project referencing a rig, which also doesn't have the file async 2`] = ` -Object { - "debug": "Configuration file \\"/lib/test/project-referencing-rig/config/notExist.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").[n]Configuration file \\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default/config/notExist.json\\" not found.[n]Configuration file \\"/lib/test/project-referencing-rig/config/notExist.json\\" not found.[n]", -} +Array [ + "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/notExist.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").[n]", + "[ debug] Configuration file \\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default/config/notExist.json\\" not found.[n]", + "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/notExist.json\\" not found.[n]", +] `; diff --git a/libraries/localization-utilities/src/parsers/test/__snapshots__/parseResx.test.ts.snap b/libraries/localization-utilities/src/parsers/test/__snapshots__/parseResx.test.ts.snap index aa6e30030b..8eabd6e39c 100644 --- a/libraries/localization-utilities/src/parsers/test/__snapshots__/parseResx.test.ts.snap +++ b/libraries/localization-utilities/src/parsers/test/__snapshots__/parseResx.test.ts.snap @@ -22,7 +22,7 @@ Array [ ] `; -exports[`parseResx correctly ignores a string: terminal output 1`] = `Object {}`; +exports[`parseResx correctly ignores a string: terminal output 1`] = `Array []`; exports[`parseResx fails to parse a RESX file with a duplicate string: Loc file 1`] = ` Object { @@ -34,9 +34,9 @@ Object { `; exports[`parseResx fails to parse a RESX file with a duplicate string: terminal output 1`] = ` -Object { - "error": "test.resx(6,45): Duplicate string value \\"stringA\\"[n]", -} +Array [ + "[ error] test.resx(6,45): Duplicate string value \\"stringA\\"[n]", +] `; exports[`parseResx ignoreMissingResxComments when set to false, warns on a missing comment: Loc file 1`] = ` @@ -49,9 +49,9 @@ Object { `; exports[`parseResx ignoreMissingResxComments when set to false, warns on a missing comment: terminal output 1`] = ` -Object { - "warning": "test.resx(3,59): Missing string comment in element[n]", -} +Array [ + "[warning] test.resx(3,59): Missing string comment in element[n]", +] `; exports[`parseResx ignoreMissingResxComments when set to true, ignores a missing comment: Loc file 1`] = ` @@ -63,7 +63,7 @@ Object { } `; -exports[`parseResx ignoreMissingResxComments when set to true, ignores a missing comment: terminal output 1`] = `Object {}`; +exports[`parseResx ignoreMissingResxComments when set to true, ignores a missing comment: terminal output 1`] = `Array []`; exports[`parseResx ignoreMissingResxComments when set to undefined, warns on a missing comment: Loc file 1`] = ` Object { @@ -74,7 +74,7 @@ Object { } `; -exports[`parseResx ignoreMissingResxComments when set to undefined, warns on a missing comment: terminal output 1`] = `Object {}`; +exports[`parseResx ignoreMissingResxComments when set to undefined, warns on a missing comment: terminal output 1`] = `Array []`; exports[`parseResx parses a valid file with a schema: Loc file 1`] = ` Object { @@ -89,7 +89,7 @@ Object { } `; -exports[`parseResx parses a valid file with a schema: terminal output 1`] = `Object {}`; +exports[`parseResx parses a valid file with a schema: terminal output 1`] = `Array []`; exports[`parseResx parses a valid file with quotemarks: Loc file 1`] = ` Object { @@ -100,7 +100,7 @@ Object { } `; -exports[`parseResx parses a valid file with quotemarks: terminal output 1`] = `Object {}`; +exports[`parseResx parses a valid file with quotemarks: terminal output 1`] = `Array []`; exports[`parseResx prints an error on invalid XML: Loc file 1`] = ` Object { @@ -112,9 +112,9 @@ Object { `; exports[`parseResx prints an error on invalid XML: terminal output 1`] = ` -Object { - "error": "test.resx(3,41): Found unexpected non-empty text node in RESX element[n]", -} +Array [ + "[ error] test.resx(3,41): Found unexpected non-empty text node in RESX element[n]", +] `; exports[`parseResx resxNewlineNormalization when set to CrLf, normalizes to CrLf: Loc file 1`] = ` @@ -128,7 +128,7 @@ Object { } `; -exports[`parseResx resxNewlineNormalization when set to CrLf, normalizes to CrLf: terminal output 1`] = `Object {}`; +exports[`parseResx resxNewlineNormalization when set to CrLf, normalizes to CrLf: terminal output 1`] = `Array []`; exports[`parseResx resxNewlineNormalization when set to Lf, normalizes to Lf: Loc file 1`] = ` Object { @@ -141,4 +141,4 @@ Object { } `; -exports[`parseResx resxNewlineNormalization when set to Lf, normalizes to Lf: terminal output 1`] = `Object {}`; +exports[`parseResx resxNewlineNormalization when set to Lf, normalizes to Lf: terminal output 1`] = `Array []`; diff --git a/libraries/localization-utilities/src/parsers/test/parseResx.test.ts b/libraries/localization-utilities/src/parsers/test/parseResx.test.ts index 2fdb440398..360fcda776 100644 --- a/libraries/localization-utilities/src/parsers/test/parseResx.test.ts +++ b/libraries/localization-utilities/src/parsers/test/parseResx.test.ts @@ -16,7 +16,9 @@ describe(parseResx.name, () => { }); afterEach(() => { - expect(terminalProvider.getAllOutput(true)).toMatchSnapshot('terminal output'); + expect(terminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true })).toMatchSnapshot( + 'terminal output' + ); }); async function testResxAsync( diff --git a/libraries/operation-graph/src/test/OperationExecutionManager.test.ts b/libraries/operation-graph/src/test/OperationExecutionManager.test.ts index f0233cbe01..c39456bcdc 100644 --- a/libraries/operation-graph/src/test/OperationExecutionManager.test.ts +++ b/libraries/operation-graph/src/test/OperationExecutionManager.test.ts @@ -68,7 +68,9 @@ describe(OperationExecutionManager.name, () => { }); expect(result).toBe(OperationStatus.NoOp); - expect(terminalProvider.getAllOutput(true)).toMatchSnapshot(); + expect( + terminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true }) + ).toMatchSnapshot(); }); it('handles trivial input', async () => { @@ -87,7 +89,9 @@ describe(OperationExecutionManager.name, () => { }); expect(result).toBe(OperationStatus.Success); - expect(terminalProvider.getAllOutput(true)).toMatchSnapshot(); + expect( + terminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true }) + ).toMatchSnapshot(); expect(operation.state?.status).toBe(OperationStatus.NoOp); }); @@ -135,7 +139,9 @@ describe(OperationExecutionManager.name, () => { }); expect(result).toBe(OperationStatus.Success); - expect(terminalProvider.getAllOutput(true)).toMatchSnapshot(); + expect( + terminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true }) + ).toMatchSnapshot(); expect(runAlpha).toHaveBeenCalledTimes(1); expect(runBeta).toHaveBeenCalledTimes(1); @@ -187,7 +193,9 @@ describe(OperationExecutionManager.name, () => { }); expect(result).toBe(OperationStatus.Failure); - expect(terminalProvider.getAllOutput(true)).toMatchSnapshot(); + expect( + terminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true }) + ).toMatchSnapshot(); expect(runAlpha).toHaveBeenCalledTimes(1); expect(runBeta).toHaveBeenCalledTimes(0); @@ -218,7 +226,9 @@ describe(OperationExecutionManager.name, () => { }); expect(result).toBe(OperationStatus.NoOp); - expect(terminalProvider.getAllOutput(true)).toMatchSnapshot(); + expect( + terminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true }) + ).toMatchSnapshot(); }); it('respects priority order', async () => { @@ -271,7 +281,9 @@ describe(OperationExecutionManager.name, () => { expect(executed).toEqual([beta, alpha]); expect(result).toBe(OperationStatus.Success); - expect(terminalProvider.getAllOutput(true)).toMatchSnapshot(); + expect( + terminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true }) + ).toMatchSnapshot(); expect(runAlpha).toHaveBeenCalledTimes(1); expect(runBeta).toHaveBeenCalledTimes(1); @@ -324,7 +336,9 @@ describe(OperationExecutionManager.name, () => { }); expect(result).toBe(OperationStatus.Success); - expect(terminalProvider.getAllOutput(true)).toMatchSnapshot(); + expect( + terminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true }) + ).toMatchSnapshot(); expect(run).toHaveBeenCalledTimes(2); @@ -391,7 +405,9 @@ describe(OperationExecutionManager.name, () => { expect(betaRequestRun).toBeDefined(); expect(result1).toBe(OperationStatus.Success); - expect(terminalProvider1.getAllOutput(true)).toMatchSnapshot('first'); + expect( + terminalProvider1.getAllOutputAsChunks({ asFlat: true, severityAsNames: true }) + ).toMatchSnapshot('first'); expect(runAlpha).toHaveBeenCalledTimes(1); expect(runBeta).toHaveBeenCalledTimes(1); @@ -423,7 +439,9 @@ describe(OperationExecutionManager.name, () => { }); expect(result2).toBe(OperationStatus.Success); - expect(terminalProvider2.getAllOutput(true)).toMatchSnapshot('second'); + expect( + terminalProvider2.getAllOutputAsChunks({ asFlat: true, severityAsNames: true }) + ).toMatchSnapshot('second'); expect(runAlpha).toHaveBeenCalledTimes(2); expect(runBeta).toHaveBeenCalledTimes(2); diff --git a/libraries/operation-graph/src/test/__snapshots__/OperationExecutionManager.test.ts.snap b/libraries/operation-graph/src/test/__snapshots__/OperationExecutionManager.test.ts.snap index 0de048fa27..34db93d6c8 100644 --- a/libraries/operation-graph/src/test/__snapshots__/OperationExecutionManager.test.ts.snap +++ b/libraries/operation-graph/src/test/__snapshots__/OperationExecutionManager.test.ts.snap @@ -3,55 +3,55 @@ exports[`OperationExecutionManager constructor throws if a dependency is not in the set 1`] = `"Operation \\"alpha\\" declares a dependency on operation \\"beta\\" that is not in the set of operations to execute."`; exports[`OperationExecutionManager executeAsync single pass blocks on failure 1`] = ` -Object { - "verbose": "Executing a maximum of 1 simultaneous tasks...[n]", -} +Array [ + "[verbose] Executing a maximum of 1 simultaneous tasks...[n]", +] `; exports[`OperationExecutionManager executeAsync single pass does not track noops 1`] = ` -Object { - "verbose": "Executing a maximum of 1 simultaneous tasks...[n]", -} +Array [ + "[verbose] Executing a maximum of 1 simultaneous tasks...[n]", +] `; exports[`OperationExecutionManager executeAsync single pass executes in order 1`] = ` -Object { - "verbose": "Executing a maximum of 1 simultaneous tasks...[n]", -} +Array [ + "[verbose] Executing a maximum of 1 simultaneous tasks...[n]", +] `; exports[`OperationExecutionManager executeAsync single pass handles empty input 1`] = ` -Object { - "verbose": "Executing a maximum of 0 simultaneous tasks...[n]", -} +Array [ + "[verbose] Executing a maximum of 0 simultaneous tasks...[n]", +] `; exports[`OperationExecutionManager executeAsync single pass handles trivial input 1`] = ` -Object { - "verbose": "Executing a maximum of 1 simultaneous tasks...[n]", -} +Array [ + "[verbose] Executing a maximum of 1 simultaneous tasks...[n]", +] `; exports[`OperationExecutionManager executeAsync single pass respects concurrency 1`] = ` -Object { - "verbose": "Executing a maximum of 2 simultaneous tasks...[n]", -} +Array [ + "[verbose] Executing a maximum of 2 simultaneous tasks...[n]", +] `; exports[`OperationExecutionManager executeAsync single pass respects priority order 1`] = ` -Object { - "verbose": "Executing a maximum of 1 simultaneous tasks...[n]", -} +Array [ + "[verbose] Executing a maximum of 1 simultaneous tasks...[n]", +] `; exports[`OperationExecutionManager executeAsync watch mode executes in order: first 1`] = ` -Object { - "verbose": "Executing a maximum of 1 simultaneous tasks...[n]", -} +Array [ + "[verbose] Executing a maximum of 1 simultaneous tasks...[n]", +] `; exports[`OperationExecutionManager executeAsync watch mode executes in order: second 1`] = ` -Object { - "verbose": "Executing a maximum of 1 simultaneous tasks...[n]", -} +Array [ + "[verbose] Executing a maximum of 1 simultaneous tasks...[n]", +] `; diff --git a/libraries/rush-lib/src/api/test/CustomTipsConfiguration.test.ts b/libraries/rush-lib/src/api/test/CustomTipsConfiguration.test.ts index 1a38ebaea0..5883f32e2c 100644 --- a/libraries/rush-lib/src/api/test/CustomTipsConfiguration.test.ts +++ b/libraries/rush-lib/src/api/test/CustomTipsConfiguration.test.ts @@ -3,10 +3,11 @@ import { JsonFile } from '@rushstack/node-core-library'; import { - type IAllStringBufferOutput, + type IOutputChunk, PrintUtilities, StringBufferTerminalProvider, - Terminal + Terminal, + type TerminalProviderSeverityName } from '@rushstack/terminal'; import { CustomTipId, CustomTipsConfiguration, type ICustomTipsJson } from '../CustomTipsConfiguration'; @@ -57,10 +58,16 @@ describe(CustomTipsConfiguration.name, () => { afterEach(() => { jest.restoreAllMocks(); - const terminalProviderOutput: Partial = terminalProvider.getAllOutput(true); - const lineSplitTerminalProviderOutput: Partial> = {}; - for (const [key, output] of Object.entries(terminalProviderOutput)) { - lineSplitTerminalProviderOutput[key as keyof IAllStringBufferOutput] = output.split('[n]'); + const terminalProviderOutput: IOutputChunk[] = + terminalProvider.getAllOutputAsChunks({ + severityAsNames: true + }); + const lineSplitTerminalProviderOutput: string[] = []; + for (const { text, severity } of terminalProviderOutput) { + const lines: string[] = text.split('[n]'); + for (const line of lines) { + lineSplitTerminalProviderOutput.push(`[${severity}] ${line}`); + } } expect(lineSplitTerminalProviderOutput).toMatchSnapshot(); diff --git a/libraries/rush-lib/src/api/test/RushProjectConfiguration.test.ts b/libraries/rush-lib/src/api/test/RushProjectConfiguration.test.ts index 914b9ecb18..d237050ccc 100644 --- a/libraries/rush-lib/src/api/test/RushProjectConfiguration.test.ts +++ b/libraries/rush-lib/src/api/test/RushProjectConfiguration.test.ts @@ -63,7 +63,9 @@ function validateConfiguration(rushProjectConfiguration: RushProjectConfiguratio terminal ); } finally { - expect(terminalProvider.getAllOutput(true)).toMatchSnapshot(); + expect( + terminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true }) + ).toMatchSnapshot(); } } } @@ -90,7 +92,9 @@ function validateConfigurationWithParameters( terminal ); } finally { - expect(terminalProvider.getAllOutput(true)).toMatchSnapshot(); + expect( + terminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true }) + ).toMatchSnapshot(); } } } diff --git a/libraries/rush-lib/src/api/test/__snapshots__/CustomTipsConfiguration.test.ts.snap b/libraries/rush-lib/src/api/test/__snapshots__/CustomTipsConfiguration.test.ts.snap index bc7d7e5a79..0f38385666 100644 --- a/libraries/rush-lib/src/api/test/__snapshots__/CustomTipsConfiguration.test.ts.snap +++ b/libraries/rush-lib/src/api/test/__snapshots__/CustomTipsConfiguration.test.ts.snap @@ -1,402 +1,377 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`CustomTipsConfiguration formatting (a long message with an indented line) _showErrorTip prints an expected message 1`] = ` -Object { - "error": Array [ - "[red]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", - "[red]|[default]", - "[red]| [default]Lorem ipsum dolor sit amet, consectetur", - "[red]| [default]adipiscing elit, sed do eiusmod tempor", - "[red]| [default]incididunt ut labore et dolore magna aliqua. Ut", - "[red]| [default]enim ad minim veniam, quis nostrud exercitation", - "[red]| [default]ullamco laboris nisi ut aliquip ex ea commodo", - "[red]| [default]consequat. Duis aute irure dolor in", - "[red]| [default]reprehenderit in voluptate velit esse cillum", - "[red]| [default]dolore eu fugiat nulla pariatur. Excepteur sint", - "[red]| [default]occaecat cupidatat non proident, sunt in culpa", - "[red]| [default]qui officia deserunt mollit anim id est laborum.", - "[red]| [default] Lorem ipsum dolor sit amet, consectetur", - "[red]| [default] adipiscing elit, sed do eiusmod tempor", - "[red]| [default] incididunt ut labore et dolore magna aliqua. Ut", - "[red]| [default] enim ad minim veniam, quis nostrud exercitation", - "[red]| [default] ullamco laboris nisi ut aliquip ex ea commodo", - "[red]| [default] consequat. Duis aute irure dolor in", - "[red]| [default] reprehenderit in voluptate velit esse cillum", - "[red]| [default] dolore eu fugiat nulla pariatur. Excepteur sint", - "[red]| [default] occaecat cupidatat non proident, sunt in culpa", - "[red]| [default] qui officia deserunt mollit anim id est laborum.", - "", - ], - "log": Array [ - "", - "", - ], -} +Array [ + "[error] [red]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", + "[error] ", + "[error] [red]|[default]", + "[error] ", + "[error] [red]| [default]Lorem ipsum dolor sit amet, consectetur", + "[error] [red]| [default]adipiscing elit, sed do eiusmod tempor", + "[error] [red]| [default]incididunt ut labore et dolore magna aliqua. Ut", + "[error] [red]| [default]enim ad minim veniam, quis nostrud exercitation", + "[error] [red]| [default]ullamco laboris nisi ut aliquip ex ea commodo", + "[error] [red]| [default]consequat. Duis aute irure dolor in", + "[error] [red]| [default]reprehenderit in voluptate velit esse cillum", + "[error] [red]| [default]dolore eu fugiat nulla pariatur. Excepteur sint", + "[error] [red]| [default]occaecat cupidatat non proident, sunt in culpa", + "[error] [red]| [default]qui officia deserunt mollit anim id est laborum.", + "[error] [red]| [default] Lorem ipsum dolor sit amet, consectetur", + "[error] [red]| [default] adipiscing elit, sed do eiusmod tempor", + "[error] [red]| [default] incididunt ut labore et dolore magna aliqua. Ut", + "[error] [red]| [default] enim ad minim veniam, quis nostrud exercitation", + "[error] [red]| [default] ullamco laboris nisi ut aliquip ex ea commodo", + "[error] [red]| [default] consequat. Duis aute irure dolor in", + "[error] [red]| [default] reprehenderit in voluptate velit esse cillum", + "[error] [red]| [default] dolore eu fugiat nulla pariatur. Excepteur sint", + "[error] [red]| [default] occaecat cupidatat non proident, sunt in culpa", + "[error] [red]| [default] qui officia deserunt mollit anim id est laborum.", + "[error] ", + "[log] ", + "[log] ", +] `; exports[`CustomTipsConfiguration formatting (a long message with an indented line) _showInfoTip prints an expected message 1`] = ` -Object { - "log": Array [ - "| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)", - "|", - "| Lorem ipsum dolor sit amet, consectetur adipiscing elit,", - "| sed do eiusmod tempor incididunt ut labore et dolore magna", - "| aliqua. Ut enim ad minim veniam, quis nostrud exercitation", - "| ullamco laboris nisi ut aliquip ex ea commodo consequat.", - "| Duis aute irure dolor in reprehenderit in voluptate velit", - "| esse cillum dolore eu fugiat nulla pariatur. Excepteur", - "| sint occaecat cupidatat non proident, sunt in culpa qui", - "| officia deserunt mollit anim id est laborum.", - "| Lorem ipsum dolor sit amet, consectetur adipiscing elit,", - "| sed do eiusmod tempor incididunt ut labore et dolore magna", - "| aliqua. Ut enim ad minim veniam, quis nostrud exercitation", - "| ullamco laboris nisi ut aliquip ex ea commodo consequat.", - "| Duis aute irure dolor in reprehenderit in voluptate velit", - "| esse cillum dolore eu fugiat nulla pariatur. Excepteur", - "| sint occaecat cupidatat non proident, sunt in culpa qui", - "| officia deserunt mollit anim id est laborum.", - "", - "", - ], -} +Array [ + "[log] | Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)", + "[log] ", + "[log] |", + "[log] ", + "[log] | Lorem ipsum dolor sit amet, consectetur adipiscing elit,", + "[log] | sed do eiusmod tempor incididunt ut labore et dolore magna", + "[log] | aliqua. Ut enim ad minim veniam, quis nostrud exercitation", + "[log] | ullamco laboris nisi ut aliquip ex ea commodo consequat.", + "[log] | Duis aute irure dolor in reprehenderit in voluptate velit", + "[log] | esse cillum dolore eu fugiat nulla pariatur. Excepteur", + "[log] | sint occaecat cupidatat non proident, sunt in culpa qui", + "[log] | officia deserunt mollit anim id est laborum.", + "[log] | Lorem ipsum dolor sit amet, consectetur adipiscing elit,", + "[log] | sed do eiusmod tempor incididunt ut labore et dolore magna", + "[log] | aliqua. Ut enim ad minim veniam, quis nostrud exercitation", + "[log] | ullamco laboris nisi ut aliquip ex ea commodo consequat.", + "[log] | Duis aute irure dolor in reprehenderit in voluptate velit", + "[log] | esse cillum dolore eu fugiat nulla pariatur. Excepteur", + "[log] | sint occaecat cupidatat non proident, sunt in culpa qui", + "[log] | officia deserunt mollit anim id est laborum.", + "[log] ", + "[log] ", + "[log] ", +] `; exports[`CustomTipsConfiguration formatting (a long message with an indented line) _showTip prints an expected message 1`] = ` -Object { - "error": Array [ - "[red]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", - "[red]|[default]", - "[red]| [default]Lorem ipsum dolor sit amet, consectetur", - "[red]| [default]adipiscing elit, sed do eiusmod tempor", - "[red]| [default]incididunt ut labore et dolore magna aliqua. Ut", - "[red]| [default]enim ad minim veniam, quis nostrud exercitation", - "[red]| [default]ullamco laboris nisi ut aliquip ex ea commodo", - "[red]| [default]consequat. Duis aute irure dolor in", - "[red]| [default]reprehenderit in voluptate velit esse cillum", - "[red]| [default]dolore eu fugiat nulla pariatur. Excepteur sint", - "[red]| [default]occaecat cupidatat non proident, sunt in culpa", - "[red]| [default]qui officia deserunt mollit anim id est laborum.", - "[red]| [default] Lorem ipsum dolor sit amet, consectetur", - "[red]| [default] adipiscing elit, sed do eiusmod tempor", - "[red]| [default] incididunt ut labore et dolore magna aliqua. Ut", - "[red]| [default] enim ad minim veniam, quis nostrud exercitation", - "[red]| [default] ullamco laboris nisi ut aliquip ex ea commodo", - "[red]| [default] consequat. Duis aute irure dolor in", - "[red]| [default] reprehenderit in voluptate velit esse cillum", - "[red]| [default] dolore eu fugiat nulla pariatur. Excepteur sint", - "[red]| [default] occaecat cupidatat non proident, sunt in culpa", - "[red]| [default] qui officia deserunt mollit anim id est laborum.", - "", - ], - "log": Array [ - "", - "", - ], -} +Array [ + "[error] [red]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", + "[error] ", + "[error] [red]|[default]", + "[error] ", + "[error] [red]| [default]Lorem ipsum dolor sit amet, consectetur", + "[error] [red]| [default]adipiscing elit, sed do eiusmod tempor", + "[error] [red]| [default]incididunt ut labore et dolore magna aliqua. Ut", + "[error] [red]| [default]enim ad minim veniam, quis nostrud exercitation", + "[error] [red]| [default]ullamco laboris nisi ut aliquip ex ea commodo", + "[error] [red]| [default]consequat. Duis aute irure dolor in", + "[error] [red]| [default]reprehenderit in voluptate velit esse cillum", + "[error] [red]| [default]dolore eu fugiat nulla pariatur. Excepteur sint", + "[error] [red]| [default]occaecat cupidatat non proident, sunt in culpa", + "[error] [red]| [default]qui officia deserunt mollit anim id est laborum.", + "[error] [red]| [default] Lorem ipsum dolor sit amet, consectetur", + "[error] [red]| [default] adipiscing elit, sed do eiusmod tempor", + "[error] [red]| [default] incididunt ut labore et dolore magna aliqua. Ut", + "[error] [red]| [default] enim ad minim veniam, quis nostrud exercitation", + "[error] [red]| [default] ullamco laboris nisi ut aliquip ex ea commodo", + "[error] [red]| [default] consequat. Duis aute irure dolor in", + "[error] [red]| [default] reprehenderit in voluptate velit esse cillum", + "[error] [red]| [default] dolore eu fugiat nulla pariatur. Excepteur sint", + "[error] [red]| [default] occaecat cupidatat non proident, sunt in culpa", + "[error] [red]| [default] qui officia deserunt mollit anim id est laborum.", + "[error] ", + "[log] ", + "[log] ", +] `; exports[`CustomTipsConfiguration formatting (a long message with an indented line) _showWarningTip prints an expected message 1`] = ` -Object { - "log": Array [ - "", - "", - ], - "warning": Array [ - "[yellow]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", - "[yellow]|[default]", - "[yellow]| [default]Lorem ipsum dolor sit amet, consectetur", - "[yellow]| [default]adipiscing elit, sed do eiusmod tempor", - "[yellow]| [default]incididunt ut labore et dolore magna aliqua. Ut", - "[yellow]| [default]enim ad minim veniam, quis nostrud exercitation", - "[yellow]| [default]ullamco laboris nisi ut aliquip ex ea commodo", - "[yellow]| [default]consequat. Duis aute irure dolor in", - "[yellow]| [default]reprehenderit in voluptate velit esse cillum", - "[yellow]| [default]dolore eu fugiat nulla pariatur. Excepteur sint", - "[yellow]| [default]occaecat cupidatat non proident, sunt in culpa", - "[yellow]| [default]qui officia deserunt mollit anim id est laborum.", - "[yellow]| [default] Lorem ipsum dolor sit amet, consectetur", - "[yellow]| [default] adipiscing elit, sed do eiusmod tempor", - "[yellow]| [default] incididunt ut labore et dolore magna aliqua. Ut", - "[yellow]| [default] enim ad minim veniam, quis nostrud exercitation", - "[yellow]| [default] ullamco laboris nisi ut aliquip ex ea commodo", - "[yellow]| [default] consequat. Duis aute irure dolor in", - "[yellow]| [default] reprehenderit in voluptate velit esse cillum", - "[yellow]| [default] dolore eu fugiat nulla pariatur. Excepteur sint", - "[yellow]| [default] occaecat cupidatat non proident, sunt in culpa", - "[yellow]| [default] qui officia deserunt mollit anim id est laborum.", - "", - ], -} +Array [ + "[warning] [yellow]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", + "[warning] ", + "[warning] [yellow]|[default]", + "[warning] ", + "[warning] [yellow]| [default]Lorem ipsum dolor sit amet, consectetur", + "[warning] [yellow]| [default]adipiscing elit, sed do eiusmod tempor", + "[warning] [yellow]| [default]incididunt ut labore et dolore magna aliqua. Ut", + "[warning] [yellow]| [default]enim ad minim veniam, quis nostrud exercitation", + "[warning] [yellow]| [default]ullamco laboris nisi ut aliquip ex ea commodo", + "[warning] [yellow]| [default]consequat. Duis aute irure dolor in", + "[warning] [yellow]| [default]reprehenderit in voluptate velit esse cillum", + "[warning] [yellow]| [default]dolore eu fugiat nulla pariatur. Excepteur sint", + "[warning] [yellow]| [default]occaecat cupidatat non proident, sunt in culpa", + "[warning] [yellow]| [default]qui officia deserunt mollit anim id est laborum.", + "[warning] [yellow]| [default] Lorem ipsum dolor sit amet, consectetur", + "[warning] [yellow]| [default] adipiscing elit, sed do eiusmod tempor", + "[warning] [yellow]| [default] incididunt ut labore et dolore magna aliqua. Ut", + "[warning] [yellow]| [default] enim ad minim veniam, quis nostrud exercitation", + "[warning] [yellow]| [default] ullamco laboris nisi ut aliquip ex ea commodo", + "[warning] [yellow]| [default] consequat. Duis aute irure dolor in", + "[warning] [yellow]| [default] reprehenderit in voluptate velit esse cillum", + "[warning] [yellow]| [default] dolore eu fugiat nulla pariatur. Excepteur sint", + "[warning] [yellow]| [default] occaecat cupidatat non proident, sunt in culpa", + "[warning] [yellow]| [default] qui officia deserunt mollit anim id est laborum.", + "[warning] ", + "[log] ", + "[log] ", +] `; exports[`CustomTipsConfiguration formatting (a long message) _showErrorTip prints an expected message 1`] = ` -Object { - "error": Array [ - "[red]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", - "[red]|[default]", - "[red]| [default]Lorem ipsum dolor sit amet, consectetur", - "[red]| [default]adipiscing elit, sed do eiusmod tempor", - "[red]| [default]incididunt ut labore et dolore magna aliqua. Ut", - "[red]| [default]enim ad minim veniam, quis nostrud exercitation", - "[red]| [default]ullamco laboris nisi ut aliquip ex ea commodo", - "[red]| [default]consequat. Duis aute irure dolor in", - "[red]| [default]reprehenderit in voluptate velit esse cillum", - "[red]| [default]dolore eu fugiat nulla pariatur. Excepteur sint", - "[red]| [default]occaecat cupidatat non proident, sunt in culpa", - "[red]| [default]qui officia deserunt mollit anim id est laborum.", - "", - ], - "log": Array [ - "", - "", - ], -} +Array [ + "[error] [red]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", + "[error] ", + "[error] [red]|[default]", + "[error] ", + "[error] [red]| [default]Lorem ipsum dolor sit amet, consectetur", + "[error] [red]| [default]adipiscing elit, sed do eiusmod tempor", + "[error] [red]| [default]incididunt ut labore et dolore magna aliqua. Ut", + "[error] [red]| [default]enim ad minim veniam, quis nostrud exercitation", + "[error] [red]| [default]ullamco laboris nisi ut aliquip ex ea commodo", + "[error] [red]| [default]consequat. Duis aute irure dolor in", + "[error] [red]| [default]reprehenderit in voluptate velit esse cillum", + "[error] [red]| [default]dolore eu fugiat nulla pariatur. Excepteur sint", + "[error] [red]| [default]occaecat cupidatat non proident, sunt in culpa", + "[error] [red]| [default]qui officia deserunt mollit anim id est laborum.", + "[error] ", + "[log] ", + "[log] ", +] `; exports[`CustomTipsConfiguration formatting (a long message) _showInfoTip prints an expected message 1`] = ` -Object { - "log": Array [ - "| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)", - "|", - "| Lorem ipsum dolor sit amet, consectetur adipiscing elit,", - "| sed do eiusmod tempor incididunt ut labore et dolore magna", - "| aliqua. Ut enim ad minim veniam, quis nostrud exercitation", - "| ullamco laboris nisi ut aliquip ex ea commodo consequat.", - "| Duis aute irure dolor in reprehenderit in voluptate velit", - "| esse cillum dolore eu fugiat nulla pariatur. Excepteur", - "| sint occaecat cupidatat non proident, sunt in culpa qui", - "| officia deserunt mollit anim id est laborum.", - "", - "", - ], -} +Array [ + "[log] | Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)", + "[log] ", + "[log] |", + "[log] ", + "[log] | Lorem ipsum dolor sit amet, consectetur adipiscing elit,", + "[log] | sed do eiusmod tempor incididunt ut labore et dolore magna", + "[log] | aliqua. Ut enim ad minim veniam, quis nostrud exercitation", + "[log] | ullamco laboris nisi ut aliquip ex ea commodo consequat.", + "[log] | Duis aute irure dolor in reprehenderit in voluptate velit", + "[log] | esse cillum dolore eu fugiat nulla pariatur. Excepteur", + "[log] | sint occaecat cupidatat non proident, sunt in culpa qui", + "[log] | officia deserunt mollit anim id est laborum.", + "[log] ", + "[log] ", + "[log] ", +] `; exports[`CustomTipsConfiguration formatting (a long message) _showTip prints an expected message 1`] = ` -Object { - "error": Array [ - "[red]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", - "[red]|[default]", - "[red]| [default]Lorem ipsum dolor sit amet, consectetur", - "[red]| [default]adipiscing elit, sed do eiusmod tempor", - "[red]| [default]incididunt ut labore et dolore magna aliqua. Ut", - "[red]| [default]enim ad minim veniam, quis nostrud exercitation", - "[red]| [default]ullamco laboris nisi ut aliquip ex ea commodo", - "[red]| [default]consequat. Duis aute irure dolor in", - "[red]| [default]reprehenderit in voluptate velit esse cillum", - "[red]| [default]dolore eu fugiat nulla pariatur. Excepteur sint", - "[red]| [default]occaecat cupidatat non proident, sunt in culpa", - "[red]| [default]qui officia deserunt mollit anim id est laborum.", - "", - ], - "log": Array [ - "", - "", - ], -} +Array [ + "[error] [red]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", + "[error] ", + "[error] [red]|[default]", + "[error] ", + "[error] [red]| [default]Lorem ipsum dolor sit amet, consectetur", + "[error] [red]| [default]adipiscing elit, sed do eiusmod tempor", + "[error] [red]| [default]incididunt ut labore et dolore magna aliqua. Ut", + "[error] [red]| [default]enim ad minim veniam, quis nostrud exercitation", + "[error] [red]| [default]ullamco laboris nisi ut aliquip ex ea commodo", + "[error] [red]| [default]consequat. Duis aute irure dolor in", + "[error] [red]| [default]reprehenderit in voluptate velit esse cillum", + "[error] [red]| [default]dolore eu fugiat nulla pariatur. Excepteur sint", + "[error] [red]| [default]occaecat cupidatat non proident, sunt in culpa", + "[error] [red]| [default]qui officia deserunt mollit anim id est laborum.", + "[error] ", + "[log] ", + "[log] ", +] `; exports[`CustomTipsConfiguration formatting (a long message) _showWarningTip prints an expected message 1`] = ` -Object { - "log": Array [ - "", - "", - ], - "warning": Array [ - "[yellow]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", - "[yellow]|[default]", - "[yellow]| [default]Lorem ipsum dolor sit amet, consectetur", - "[yellow]| [default]adipiscing elit, sed do eiusmod tempor", - "[yellow]| [default]incididunt ut labore et dolore magna aliqua. Ut", - "[yellow]| [default]enim ad minim veniam, quis nostrud exercitation", - "[yellow]| [default]ullamco laboris nisi ut aliquip ex ea commodo", - "[yellow]| [default]consequat. Duis aute irure dolor in", - "[yellow]| [default]reprehenderit in voluptate velit esse cillum", - "[yellow]| [default]dolore eu fugiat nulla pariatur. Excepteur sint", - "[yellow]| [default]occaecat cupidatat non proident, sunt in culpa", - "[yellow]| [default]qui officia deserunt mollit anim id est laborum.", - "", - ], -} +Array [ + "[warning] [yellow]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", + "[warning] ", + "[warning] [yellow]|[default]", + "[warning] ", + "[warning] [yellow]| [default]Lorem ipsum dolor sit amet, consectetur", + "[warning] [yellow]| [default]adipiscing elit, sed do eiusmod tempor", + "[warning] [yellow]| [default]incididunt ut labore et dolore magna aliqua. Ut", + "[warning] [yellow]| [default]enim ad minim veniam, quis nostrud exercitation", + "[warning] [yellow]| [default]ullamco laboris nisi ut aliquip ex ea commodo", + "[warning] [yellow]| [default]consequat. Duis aute irure dolor in", + "[warning] [yellow]| [default]reprehenderit in voluptate velit esse cillum", + "[warning] [yellow]| [default]dolore eu fugiat nulla pariatur. Excepteur sint", + "[warning] [yellow]| [default]occaecat cupidatat non proident, sunt in culpa", + "[warning] [yellow]| [default]qui officia deserunt mollit anim id est laborum.", + "[warning] ", + "[log] ", + "[log] ", +] `; exports[`CustomTipsConfiguration formatting (a message with an indented line) _showErrorTip prints an expected message 1`] = ` -Object { - "error": Array [ - "[red]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", - "[red]|[default]", - "[red]| [default]This is a test", - "[red]| [default] This is a test", - "", - ], - "log": Array [ - "", - "", - ], -} +Array [ + "[error] [red]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", + "[error] ", + "[error] [red]|[default]", + "[error] ", + "[error] [red]| [default]This is a test", + "[error] [red]| [default] This is a test", + "[error] ", + "[log] ", + "[log] ", +] `; exports[`CustomTipsConfiguration formatting (a message with an indented line) _showInfoTip prints an expected message 1`] = ` -Object { - "log": Array [ - "| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)", - "|", - "| This is a test", - "| This is a test", - "", - "", - ], -} +Array [ + "[log] | Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)", + "[log] ", + "[log] |", + "[log] ", + "[log] | This is a test", + "[log] | This is a test", + "[log] ", + "[log] ", + "[log] ", +] `; exports[`CustomTipsConfiguration formatting (a message with an indented line) _showTip prints an expected message 1`] = ` -Object { - "error": Array [ - "[red]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", - "[red]|[default]", - "[red]| [default]This is a test", - "[red]| [default] This is a test", - "", - ], - "log": Array [ - "", - "", - ], -} +Array [ + "[error] [red]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", + "[error] ", + "[error] [red]|[default]", + "[error] ", + "[error] [red]| [default]This is a test", + "[error] [red]| [default] This is a test", + "[error] ", + "[log] ", + "[log] ", +] `; exports[`CustomTipsConfiguration formatting (a message with an indented line) _showWarningTip prints an expected message 1`] = ` -Object { - "log": Array [ - "", - "", - ], - "warning": Array [ - "[yellow]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", - "[yellow]|[default]", - "[yellow]| [default]This is a test", - "[yellow]| [default] This is a test", - "", - ], -} +Array [ + "[warning] [yellow]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", + "[warning] ", + "[warning] [yellow]|[default]", + "[warning] ", + "[warning] [yellow]| [default]This is a test", + "[warning] [yellow]| [default] This is a test", + "[warning] ", + "[log] ", + "[log] ", +] `; exports[`CustomTipsConfiguration formatting (a message with newlines) _showErrorTip prints an expected message 1`] = ` -Object { - "error": Array [ - "[red]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", - "[red]|[default]", - "[red]| [default]This is a test", - "[red]| [default]This is a test", - "", - ], - "log": Array [ - "", - "", - ], -} +Array [ + "[error] [red]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", + "[error] ", + "[error] [red]|[default]", + "[error] ", + "[error] [red]| [default]This is a test", + "[error] [red]| [default]This is a test", + "[error] ", + "[log] ", + "[log] ", +] `; exports[`CustomTipsConfiguration formatting (a message with newlines) _showInfoTip prints an expected message 1`] = ` -Object { - "log": Array [ - "| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)", - "|", - "| This is a test", - "| This is a test", - "", - "", - ], -} +Array [ + "[log] | Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)", + "[log] ", + "[log] |", + "[log] ", + "[log] | This is a test", + "[log] | This is a test", + "[log] ", + "[log] ", + "[log] ", +] `; exports[`CustomTipsConfiguration formatting (a message with newlines) _showTip prints an expected message 1`] = ` -Object { - "error": Array [ - "[red]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", - "[red]|[default]", - "[red]| [default]This is a test", - "[red]| [default]This is a test", - "", - ], - "log": Array [ - "", - "", - ], -} +Array [ + "[error] [red]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", + "[error] ", + "[error] [red]|[default]", + "[error] ", + "[error] [red]| [default]This is a test", + "[error] [red]| [default]This is a test", + "[error] ", + "[log] ", + "[log] ", +] `; exports[`CustomTipsConfiguration formatting (a message with newlines) _showWarningTip prints an expected message 1`] = ` -Object { - "log": Array [ - "", - "", - ], - "warning": Array [ - "[yellow]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", - "[yellow]|[default]", - "[yellow]| [default]This is a test", - "[yellow]| [default]This is a test", - "", - ], -} +Array [ + "[warning] [yellow]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", + "[warning] ", + "[warning] [yellow]|[default]", + "[warning] ", + "[warning] [yellow]| [default]This is a test", + "[warning] [yellow]| [default]This is a test", + "[warning] ", + "[log] ", + "[log] ", +] `; exports[`CustomTipsConfiguration formatting (a short message) _showErrorTip prints an expected message 1`] = ` -Object { - "error": Array [ - "[red]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", - "[red]|[default]", - "[red]| [default]This is a test", - "", - ], - "log": Array [ - "", - "", - ], -} +Array [ + "[error] [red]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", + "[error] ", + "[error] [red]|[default]", + "[error] ", + "[error] [red]| [default]This is a test", + "[error] ", + "[log] ", + "[log] ", +] `; exports[`CustomTipsConfiguration formatting (a short message) _showInfoTip prints an expected message 1`] = ` -Object { - "log": Array [ - "| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)", - "|", - "| This is a test", - "", - "", - ], -} +Array [ + "[log] | Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)", + "[log] ", + "[log] |", + "[log] ", + "[log] | This is a test", + "[log] ", + "[log] ", + "[log] ", +] `; exports[`CustomTipsConfiguration formatting (a short message) _showTip prints an expected message 1`] = ` -Object { - "error": Array [ - "[red]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", - "[red]|[default]", - "[red]| [default]This is a test", - "", - ], - "log": Array [ - "", - "", - ], -} +Array [ + "[error] [red]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", + "[error] ", + "[error] [red]|[default]", + "[error] ", + "[error] [red]| [default]This is a test", + "[error] ", + "[log] ", + "[log] ", +] `; exports[`CustomTipsConfiguration formatting (a short message) _showWarningTip prints an expected message 1`] = ` -Object { - "log": Array [ - "", - "", - ], - "warning": Array [ - "[yellow]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", - "[yellow]|[default]", - "[yellow]| [default]This is a test", - "", - ], -} +Array [ + "[warning] [yellow]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", + "[warning] ", + "[warning] [yellow]|[default]", + "[warning] ", + "[warning] [yellow]| [default]This is a test", + "[warning] ", + "[log] ", + "[log] ", +] `; exports[`CustomTipsConfiguration loads the config file (custom-tips.json) 1`] = ` diff --git a/libraries/rush-lib/src/api/test/__snapshots__/RushProjectConfiguration.test.ts.snap b/libraries/rush-lib/src/api/test/__snapshots__/RushProjectConfiguration.test.ts.snap index 77b7f7c2bb..987a503a40 100644 --- a/libraries/rush-lib/src/api/test/__snapshots__/RushProjectConfiguration.test.ts.snap +++ b/libraries/rush-lib/src/api/test/__snapshots__/RushProjectConfiguration.test.ts.snap @@ -10,7 +10,7 @@ exports[`RushProjectConfiguration getCacheDisabledReason Indicates if tracked fi exports[`RushProjectConfiguration getCacheDisabledReason returns reason if the operation is runnable 1`] = `"Caching has been disabled for this project's \\"_phase:a\\" command."`; -exports[`RushProjectConfiguration operationSettingsByOperationName allows outputFolderNames to be inside subfolders 1`] = `Object {}`; +exports[`RushProjectConfiguration operationSettingsByOperationName allows outputFolderNames to be inside subfolders 1`] = `Array []`; exports[`RushProjectConfiguration operationSettingsByOperationName allows outputFolderNames to be inside subfolders 2`] = ` Map { @@ -31,12 +31,12 @@ Map { `; exports[`RushProjectConfiguration operationSettingsByOperationName does not allow one outputFolderName to be under another 1`] = ` -Object { - "error": "The project \\"test-project-d\\" has a \\"config/rush-project.json\\" configuration that defines two operations in the same command whose \\"outputFolderNames\\" would overlap. Operations outputs in the same command must be disjoint so that they can be independently cached. The \\"a/b\\" path overlaps between these operations: \\"_phase:b\\", \\"_phase:a\\"[n]", -} +Array [ + "[ error] The project \\"test-project-d\\" has a \\"config/rush-project.json\\" configuration that defines two operations in the same command whose \\"outputFolderNames\\" would overlap. Operations outputs in the same command must be disjoint so that they can be independently cached. The \\"a/b\\" path overlaps between these operations: \\"_phase:b\\", \\"_phase:a\\"[n]", +] `; -exports[`RushProjectConfiguration operationSettingsByOperationName loads a rush-project.json config that extends another config file 1`] = `Object {}`; +exports[`RushProjectConfiguration operationSettingsByOperationName loads a rush-project.json config that extends another config file 1`] = `Array []`; exports[`RushProjectConfiguration operationSettingsByOperationName loads a rush-project.json config that extends another config file 2`] = ` Map { @@ -59,19 +59,19 @@ Map { exports[`RushProjectConfiguration operationSettingsByOperationName throws an error when loading a rush-project.json config that lists an operation twice 1`] = `"The operation \\"_phase:a\\" occurs multiple times in the \\"operationSettings\\" array in \\"/config/rush-project.json\\"."`; exports[`RushProjectConfiguration operationSettingsByOperationName validates mix of existent and nonexistent parameters 1`] = ` -Object { - "error": "The project \\"test-project-g\\" has a \\"config/rush-project.json\\" configuration that specifies invalid parameter(s) in \\"parameterNamesToIgnore\\" for operation \\"_phase:build\\": --nonexistent-param. Valid parameters for this operation are: --production, --verbose.[n]", -} +Array [ + "[ error] The project \\"test-project-g\\" has a \\"config/rush-project.json\\" configuration that specifies invalid parameter(s) in \\"parameterNamesToIgnore\\" for operation \\"_phase:build\\": --nonexistent-param. Valid parameters for this operation are: --production, --verbose.[n]", +] `; exports[`RushProjectConfiguration operationSettingsByOperationName validates nonexistent parameters when operation has valid parameters 1`] = ` -Object { - "error": "The project \\"test-project-f\\" has a \\"config/rush-project.json\\" configuration that specifies invalid parameter(s) in \\"parameterNamesToIgnore\\" for operation \\"_phase:build\\": --nonexistent-param, --another-nonexistent. Valid parameters for this operation are: --production, --verbose.[n]", -} +Array [ + "[ error] The project \\"test-project-f\\" has a \\"config/rush-project.json\\" configuration that specifies invalid parameter(s) in \\"parameterNamesToIgnore\\" for operation \\"_phase:build\\": --nonexistent-param, --another-nonexistent. Valid parameters for this operation are: --production, --verbose.[n]", +] `; exports[`RushProjectConfiguration operationSettingsByOperationName validates that parameters in parameterNamesToIgnore exist for the operation 1`] = ` -Object { - "error": "The project \\"test-project-e\\" has a \\"config/rush-project.json\\" configuration that specifies invalid parameter(s) in \\"parameterNamesToIgnore\\" for operation \\"_phase:build\\": --invalid-parameter, --another-invalid, -malformed-parameter. Valid parameters for this operation are: (none).[n]", -} +Array [ + "[ error] The project \\"test-project-e\\" has a \\"config/rush-project.json\\" configuration that specifies invalid parameter(s) in \\"parameterNamesToIgnore\\" for operation \\"_phase:build\\": --invalid-parameter, --another-invalid, -malformed-parameter. Valid parameters for this operation are: (none).[n]", +] `; diff --git a/libraries/rush-lib/src/logic/operations/test/BuildPlanPlugin.test.ts b/libraries/rush-lib/src/logic/operations/test/BuildPlanPlugin.test.ts index b619d0a017..9a7b6d56e1 100644 --- a/libraries/rush-lib/src/logic/operations/test/BuildPlanPlugin.test.ts +++ b/libraries/rush-lib/src/logic/operations/test/BuildPlanPlugin.test.ts @@ -139,7 +139,11 @@ describe(BuildPlanPlugin.name, () => { await hooks.beforeExecuteOperations.promise(operationMap, context as IExecuteOperationsContext); expect( - stringBufferTerminalProvider.getAllOutput(true, { normalizeSpecialCharacters: false }) + stringBufferTerminalProvider.getAllOutputAsChunks({ + normalizeSpecialCharacters: false, + asFlat: true, + severityAsNames: true + }) ).toMatchSnapshot(); }); }); diff --git a/libraries/rush-lib/src/logic/operations/test/OperationMetadataManager.test.ts b/libraries/rush-lib/src/logic/operations/test/OperationMetadataManager.test.ts index 13efc4415e..2c3c97db06 100644 --- a/libraries/rush-lib/src/logic/operations/test/OperationMetadataManager.test.ts +++ b/libraries/rush-lib/src/logic/operations/test/OperationMetadataManager.test.ts @@ -63,7 +63,9 @@ describe(OperationMetadataManager.name, () => { errorLogPath: '/path/to/errorLog' }); - expect(mockTerminalProvider.getAllOutput(true)).toMatchSnapshot(); + expect( + mockTerminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true }) + ).toMatchSnapshot(); expect(mockTerminalProvider.getWarningOutput()).toBeFalsy(); }); @@ -87,7 +89,9 @@ describe(OperationMetadataManager.name, () => { errorLogPath: '/path/to/errorLog' }); - expect(mockTerminalProvider.getAllOutput(true)).toMatchSnapshot(); + expect( + mockTerminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true }) + ).toMatchSnapshot(); }); it('should restore mixed chunked output', async () => { @@ -109,7 +113,9 @@ describe(OperationMetadataManager.name, () => { terminalProvider: mockTerminalProvider, errorLogPath: '/path/to/errorLog' }); - expect(mockTerminalProvider.getAllOutput(true)).toMatchSnapshot(); + expect( + mockTerminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true }) + ).toMatchSnapshot(); }); it("should fallback to the log file when chunked output isn't available", async () => { @@ -130,7 +136,7 @@ describe(OperationMetadataManager.name, () => { errorLogPath: '/path/to/errorLog' }); - expect(mockTerminalProvider.getAllOutput(true)).toEqual({}); + expect(mockTerminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true })).toEqual({}); expect(mockClose).toHaveBeenCalledTimes(1); expect(mockWritable.chunks).toMatchSnapshot(); }); diff --git a/libraries/rush-lib/src/logic/operations/test/__snapshots__/BuildPlanPlugin.test.ts.snap b/libraries/rush-lib/src/logic/operations/test/__snapshots__/BuildPlanPlugin.test.ts.snap index dcc4321458..c1315986b0 100644 --- a/libraries/rush-lib/src/logic/operations/test/__snapshots__/BuildPlanPlugin.test.ts.snap +++ b/libraries/rush-lib/src/logic/operations/test/__snapshots__/BuildPlanPlugin.test.ts.snap @@ -1,215 +1,422 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`BuildPlanPlugin build plan debugging should generate a build plan 1`] = ` -Object { - "log": "Build Plan Depth (deepest dependency tree): 5 -Build Plan Width (maximum parallelism): 38 -Number of Nodes per Depth: 22, 38, 33, 11, 1 -Plan @ Depth 0 has 22 nodes and 0 dependents: -- a (no-deps) -- b (no-deps) -- c (no-deps) -- d (no-deps) -- e (no-deps) -- f (no-deps) -- g (no-deps) -- h (no-deps) -- a (upstream-1) -- a (upstream-2) -- a (upstream-1-self-upstream) -- i (no-deps) -- j (no-deps) -- i (upstream-1) -- j (upstream-1) -- i (upstream-2) -- j (upstream-2) -- a (upstream-3) -- i (upstream-3) -- j (upstream-3) -- i (upstream-1-self-upstream) -- j (upstream-1-self-upstream) -Plan @ Depth 1 has 38 nodes and 22 dependents: -- a (upstream-self) -- b (upstream-1) -- f (upstream-1) -- g (upstream-1) -- h (upstream-1) -- b (upstream-self) -- c (upstream-1) -- d (upstream-1) -- c (upstream-self) -- e (upstream-1) -- d (upstream-self) -- e (upstream-self) -- f (upstream-self) -- g (upstream-self) -- h (upstream-self) -- b (upstream-2) -- f (upstream-2) -- g (upstream-2) -- h (upstream-2) -- a (upstream-1-self) -- b (upstream-3) -- f (upstream-3) -- g (upstream-3) -- h (upstream-3) -- a (upstream-2-self) -- b (complex) -- f (complex) -- g (complex) -- h (complex) -- i (upstream-self) -- j (upstream-self) -- i (upstream-1-self) -- j (upstream-1-self) -- i (upstream-2-self) -- j (upstream-2-self) -- a (complex) -- i (complex) -- j (complex) -Plan @ Depth 2 has 33 nodes and 60 dependents: -- b (upstream-self) -- f (upstream-self) -- h (upstream-self) -- g (upstream-self) -- c (upstream-2) -- d (upstream-2) -- b (upstream-1-self) -- f (upstream-1-self) -- g (upstream-1-self) -- f (upstream-2) -- h (upstream-1-self) -- c (upstream-self) -- d (upstream-self) -- e (upstream-2) -- c (upstream-1-self) -- d (upstream-1-self) -- e (upstream-self) -- e (upstream-1-self) -- c (upstream-3) -- d (upstream-3) -- b (upstream-2-self) -- f (upstream-2-self) -- g (upstream-2-self) -- f (upstream-3) -- h (upstream-2-self) -- b (upstream-1-self-upstream) -- f (upstream-1-self-upstream) -- g (upstream-1-self-upstream) -- h (upstream-1-self-upstream) -- b (complex) -- f (complex) -- g (complex) -- h (complex) -Plan @ Depth 3 has 11 nodes and 93 dependents: -- e (upstream-3) -- c (upstream-2-self) -- d (upstream-2-self) -- c (upstream-1-self-upstream) -- d (upstream-1-self-upstream) -- f (upstream-1-self-upstream) -- e (upstream-2-self) -- e (upstream-1-self-upstream) -- c (complex) -- d (complex) -- f (complex) -Plan @ Depth 4 has 1 nodes and 104 dependents: -- e (complex) -################################################## - a (no-deps): (0) - b (no-deps): (0) - c (no-deps): (0) - d (no-deps): (0) - e (no-deps): (0) - f (no-deps): (0) - g (no-deps): (0) - h (no-deps): (0) - a (upstream-1): (0) - a (upstream-2): (0) - a (upstream-1-self-upstream): (0) - i (no-deps): (1) - j (no-deps): (2) - i (upstream-1): (3) - j (upstream-1): (4) - i (upstream-2): (5) - j (upstream-2): (6) - a (upstream-3): (7) - i (upstream-3): (8) - j (upstream-3): (9) - i (upstream-1-self-upstream): (10) - j (upstream-1-self-upstream): (11) - a (upstream-self): -(0) - b (upstream-1): -(0) - c (upstream-1): -(0) - d (upstream-1): -(0) - e (upstream-1): -(0) - f (upstream-1): -(0) - g (upstream-1): -(0) - h (upstream-1): -(0) - b (upstream-2): -(0) - g (upstream-2): -(0) - h (upstream-2): -(0) - b (upstream-3): -(0) - g (upstream-3): -(0) - h (upstream-3): -(0) - a (upstream-1-self): -(0) - a (upstream-2-self): -(0) - i (upstream-self): -(1) - j (upstream-self): -(2) - i (upstream-1-self): -(3) - j (upstream-1-self): -(4) - i (upstream-2-self): -(5) - j (upstream-2-self): -(6) - a (complex): -(7) - i (complex): -(8) - j (complex): -(9) - b (upstream-self): --(0) - f (upstream-self): --(0) - h (upstream-self): --(0) - g (upstream-self): --(0) - c (upstream-2): --(0) - d (upstream-2): --(0) - e (upstream-2): --(0) - f (upstream-2): --(0) - c (upstream-3): --(0) - d (upstream-3): --(0) - f (upstream-3): --(0) - b (upstream-1-self): --(0) - c (upstream-1-self): --(0) - d (upstream-1-self): --(0) - e (upstream-1-self): --(0) - f (upstream-1-self): --(0) - g (upstream-1-self): --(0) - h (upstream-1-self): --(0) - b (upstream-2-self): --(0) - g (upstream-2-self): --(0) - h (upstream-2-self): --(0) - b (upstream-1-self-upstream): --(0) - g (upstream-1-self-upstream): --(0) - h (upstream-1-self-upstream): --(0) - b (complex): --(0) - g (complex): --(0) - h (complex): --(0) - c (upstream-self): ---(0) - d (upstream-self): ---(0) - e (upstream-3): ---(0) - c (upstream-2-self): ---(0) - d (upstream-2-self): ---(0) - e (upstream-2-self): ---(0) - f (upstream-2-self): ---(0) - c (upstream-1-self-upstream): ---(0) - d (upstream-1-self-upstream): ---(0) - e (upstream-1-self-upstream): ---(0) - f (upstream-1-self-upstream): ---(0) - c (complex): ---(0) - d (complex): ---(0) - f (complex): ---(0) - e (upstream-self): ----(0) - e (complex): ----(0) -################################################## -Cluster 0: -- Dependencies: none -- Clustered by: +Array [ + "[ log] Build Plan Depth (deepest dependency tree): 5 +", + "[ log] Build Plan Width (maximum parallelism): 38 +", + "[ log] Number of Nodes per Depth: 22, 38, 33, 11, 1 +", + "[ log] Plan @ Depth 0 has 22 nodes and 0 dependents: +", + "[ log] - a (no-deps) +", + "[ log] - b (no-deps) +", + "[ log] - c (no-deps) +", + "[ log] - d (no-deps) +", + "[ log] - e (no-deps) +", + "[ log] - f (no-deps) +", + "[ log] - g (no-deps) +", + "[ log] - h (no-deps) +", + "[ log] - a (upstream-1) +", + "[ log] - a (upstream-2) +", + "[ log] - a (upstream-1-self-upstream) +", + "[ log] - i (no-deps) +", + "[ log] - j (no-deps) +", + "[ log] - i (upstream-1) +", + "[ log] - j (upstream-1) +", + "[ log] - i (upstream-2) +", + "[ log] - j (upstream-2) +", + "[ log] - a (upstream-3) +", + "[ log] - i (upstream-3) +", + "[ log] - j (upstream-3) +", + "[ log] - i (upstream-1-self-upstream) +", + "[ log] - j (upstream-1-self-upstream) +", + "[ log] Plan @ Depth 1 has 38 nodes and 22 dependents: +", + "[ log] - a (upstream-self) +", + "[ log] - b (upstream-1) +", + "[ log] - f (upstream-1) +", + "[ log] - g (upstream-1) +", + "[ log] - h (upstream-1) +", + "[ log] - b (upstream-self) +", + "[ log] - c (upstream-1) +", + "[ log] - d (upstream-1) +", + "[ log] - c (upstream-self) +", + "[ log] - e (upstream-1) +", + "[ log] - d (upstream-self) +", + "[ log] - e (upstream-self) +", + "[ log] - f (upstream-self) +", + "[ log] - g (upstream-self) +", + "[ log] - h (upstream-self) +", + "[ log] - b (upstream-2) +", + "[ log] - f (upstream-2) +", + "[ log] - g (upstream-2) +", + "[ log] - h (upstream-2) +", + "[ log] - a (upstream-1-self) +", + "[ log] - b (upstream-3) +", + "[ log] - f (upstream-3) +", + "[ log] - g (upstream-3) +", + "[ log] - h (upstream-3) +", + "[ log] - a (upstream-2-self) +", + "[ log] - b (complex) +", + "[ log] - f (complex) +", + "[ log] - g (complex) +", + "[ log] - h (complex) +", + "[ log] - i (upstream-self) +", + "[ log] - j (upstream-self) +", + "[ log] - i (upstream-1-self) +", + "[ log] - j (upstream-1-self) +", + "[ log] - i (upstream-2-self) +", + "[ log] - j (upstream-2-self) +", + "[ log] - a (complex) +", + "[ log] - i (complex) +", + "[ log] - j (complex) +", + "[ log] Plan @ Depth 2 has 33 nodes and 60 dependents: +", + "[ log] - b (upstream-self) +", + "[ log] - f (upstream-self) +", + "[ log] - h (upstream-self) +", + "[ log] - g (upstream-self) +", + "[ log] - c (upstream-2) +", + "[ log] - d (upstream-2) +", + "[ log] - b (upstream-1-self) +", + "[ log] - f (upstream-1-self) +", + "[ log] - g (upstream-1-self) +", + "[ log] - f (upstream-2) +", + "[ log] - h (upstream-1-self) +", + "[ log] - c (upstream-self) +", + "[ log] - d (upstream-self) +", + "[ log] - e (upstream-2) +", + "[ log] - c (upstream-1-self) +", + "[ log] - d (upstream-1-self) +", + "[ log] - e (upstream-self) +", + "[ log] - e (upstream-1-self) +", + "[ log] - c (upstream-3) +", + "[ log] - d (upstream-3) +", + "[ log] - b (upstream-2-self) +", + "[ log] - f (upstream-2-self) +", + "[ log] - g (upstream-2-self) +", + "[ log] - f (upstream-3) +", + "[ log] - h (upstream-2-self) +", + "[ log] - b (upstream-1-self-upstream) +", + "[ log] - f (upstream-1-self-upstream) +", + "[ log] - g (upstream-1-self-upstream) +", + "[ log] - h (upstream-1-self-upstream) +", + "[ log] - b (complex) +", + "[ log] - f (complex) +", + "[ log] - g (complex) +", + "[ log] - h (complex) +", + "[ log] Plan @ Depth 3 has 11 nodes and 93 dependents: +", + "[ log] - e (upstream-3) +", + "[ log] - c (upstream-2-self) +", + "[ log] - d (upstream-2-self) +", + "[ log] - c (upstream-1-self-upstream) +", + "[ log] - d (upstream-1-self-upstream) +", + "[ log] - f (upstream-1-self-upstream) +", + "[ log] - e (upstream-2-self) +", + "[ log] - e (upstream-1-self-upstream) +", + "[ log] - c (complex) +", + "[ log] - d (complex) +", + "[ log] - f (complex) +", + "[ log] Plan @ Depth 4 has 1 nodes and 104 dependents: +", + "[ log] - e (complex) +", + "[ log] ################################################## +", + "[ log] a (no-deps): (0) +", + "[ log] b (no-deps): (0) +", + "[ log] c (no-deps): (0) +", + "[ log] d (no-deps): (0) +", + "[ log] e (no-deps): (0) +", + "[ log] f (no-deps): (0) +", + "[ log] g (no-deps): (0) +", + "[ log] h (no-deps): (0) +", + "[ log] a (upstream-1): (0) +", + "[ log] a (upstream-2): (0) +", + "[ log] a (upstream-1-self-upstream): (0) +", + "[ log] i (no-deps): (1) +", + "[ log] j (no-deps): (2) +", + "[ log] i (upstream-1): (3) +", + "[ log] j (upstream-1): (4) +", + "[ log] i (upstream-2): (5) +", + "[ log] j (upstream-2): (6) +", + "[ log] a (upstream-3): (7) +", + "[ log] i (upstream-3): (8) +", + "[ log] j (upstream-3): (9) +", + "[ log] i (upstream-1-self-upstream): (10) +", + "[ log] j (upstream-1-self-upstream): (11) +", + "[ log] a (upstream-self): -(0) +", + "[ log] b (upstream-1): -(0) +", + "[ log] c (upstream-1): -(0) +", + "[ log] d (upstream-1): -(0) +", + "[ log] e (upstream-1): -(0) +", + "[ log] f (upstream-1): -(0) +", + "[ log] g (upstream-1): -(0) +", + "[ log] h (upstream-1): -(0) +", + "[ log] b (upstream-2): -(0) +", + "[ log] g (upstream-2): -(0) +", + "[ log] h (upstream-2): -(0) +", + "[ log] b (upstream-3): -(0) +", + "[ log] g (upstream-3): -(0) +", + "[ log] h (upstream-3): -(0) +", + "[ log] a (upstream-1-self): -(0) +", + "[ log] a (upstream-2-self): -(0) +", + "[ log] i (upstream-self): -(1) +", + "[ log] j (upstream-self): -(2) +", + "[ log] i (upstream-1-self): -(3) +", + "[ log] j (upstream-1-self): -(4) +", + "[ log] i (upstream-2-self): -(5) +", + "[ log] j (upstream-2-self): -(6) +", + "[ log] a (complex): -(7) +", + "[ log] i (complex): -(8) +", + "[ log] j (complex): -(9) +", + "[ log] b (upstream-self): --(0) +", + "[ log] f (upstream-self): --(0) +", + "[ log] h (upstream-self): --(0) +", + "[ log] g (upstream-self): --(0) +", + "[ log] c (upstream-2): --(0) +", + "[ log] d (upstream-2): --(0) +", + "[ log] e (upstream-2): --(0) +", + "[ log] f (upstream-2): --(0) +", + "[ log] c (upstream-3): --(0) +", + "[ log] d (upstream-3): --(0) +", + "[ log] f (upstream-3): --(0) +", + "[ log] b (upstream-1-self): --(0) +", + "[ log] c (upstream-1-self): --(0) +", + "[ log] d (upstream-1-self): --(0) +", + "[ log] e (upstream-1-self): --(0) +", + "[ log] f (upstream-1-self): --(0) +", + "[ log] g (upstream-1-self): --(0) +", + "[ log] h (upstream-1-self): --(0) +", + "[ log] b (upstream-2-self): --(0) +", + "[ log] g (upstream-2-self): --(0) +", + "[ log] h (upstream-2-self): --(0) +", + "[ log] b (upstream-1-self-upstream): --(0) +", + "[ log] g (upstream-1-self-upstream): --(0) +", + "[ log] h (upstream-1-self-upstream): --(0) +", + "[ log] b (complex): --(0) +", + "[ log] g (complex): --(0) +", + "[ log] h (complex): --(0) +", + "[ log] c (upstream-self): ---(0) +", + "[ log] d (upstream-self): ---(0) +", + "[ log] e (upstream-3): ---(0) +", + "[ log] c (upstream-2-self): ---(0) +", + "[ log] d (upstream-2-self): ---(0) +", + "[ log] e (upstream-2-self): ---(0) +", + "[ log] f (upstream-2-self): ---(0) +", + "[ log] c (upstream-1-self-upstream): ---(0) +", + "[ log] d (upstream-1-self-upstream): ---(0) +", + "[ log] e (upstream-1-self-upstream): ---(0) +", + "[ log] f (upstream-1-self-upstream): ---(0) +", + "[ log] c (complex): ---(0) +", + "[ log] d (complex): ---(0) +", + "[ log] f (complex): ---(0) +", + "[ log] e (upstream-self): ----(0) +", + "[ log] e (complex): ----(0) +", + "[ log] ################################################## +", + "[ log] Cluster 0: +", + "[ log] - Dependencies: none +", + "[ log] - Clustered by: - (a (no-deps)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - (b (no-deps)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - (a (upstream-self)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" @@ -257,71 +464,127 @@ Cluster 0: - (h (upstream-2-self)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - (g (upstream-3)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - (h (upstream-3)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" -- Operations: a (no-deps), b (no-deps), c (no-deps), d (no-deps), e (no-deps), f (no-deps), g (no-deps), h (no-deps), a (upstream-self), b (upstream-self), c (upstream-self), d (upstream-self), e (upstream-self), f (upstream-self), h (upstream-self), g (upstream-self), a (upstream-1), b (upstream-1), c (upstream-1), d (upstream-1), e (upstream-1), f (upstream-1), g (upstream-1), h (upstream-1), a (upstream-2), b (upstream-2), c (upstream-2), d (upstream-2), e (upstream-2), f (upstream-2), g (upstream-2), h (upstream-2), b (upstream-3), c (upstream-3), d (upstream-3), e (upstream-3), f (upstream-3), g (upstream-3), h (upstream-3), a (upstream-1-self), b (upstream-1-self), c (upstream-1-self), d (upstream-1-self), e (upstream-1-self), f (upstream-1-self), g (upstream-1-self), h (upstream-1-self), a (upstream-2-self), b (upstream-2-self), c (upstream-2-self), d (upstream-2-self), e (upstream-2-self), f (upstream-2-self), g (upstream-2-self), h (upstream-2-self), a (upstream-1-self-upstream), b (upstream-1-self-upstream), c (upstream-1-self-upstream), d (upstream-1-self-upstream), e (upstream-1-self-upstream), f (upstream-1-self-upstream), g (upstream-1-self-upstream), h (upstream-1-self-upstream), b (complex), c (complex), d (complex), e (complex), f (complex), g (complex), h (complex) --------------------------------------------------- -Cluster 1: -- Dependencies: none -- Clustered by: +", + "[ log] - Operations: a (no-deps), b (no-deps), c (no-deps), d (no-deps), e (no-deps), f (no-deps), g (no-deps), h (no-deps), a (upstream-self), b (upstream-self), c (upstream-self), d (upstream-self), e (upstream-self), f (upstream-self), h (upstream-self), g (upstream-self), a (upstream-1), b (upstream-1), c (upstream-1), d (upstream-1), e (upstream-1), f (upstream-1), g (upstream-1), h (upstream-1), a (upstream-2), b (upstream-2), c (upstream-2), d (upstream-2), e (upstream-2), f (upstream-2), g (upstream-2), h (upstream-2), b (upstream-3), c (upstream-3), d (upstream-3), e (upstream-3), f (upstream-3), g (upstream-3), h (upstream-3), a (upstream-1-self), b (upstream-1-self), c (upstream-1-self), d (upstream-1-self), e (upstream-1-self), f (upstream-1-self), g (upstream-1-self), h (upstream-1-self), a (upstream-2-self), b (upstream-2-self), c (upstream-2-self), d (upstream-2-self), e (upstream-2-self), f (upstream-2-self), g (upstream-2-self), h (upstream-2-self), a (upstream-1-self-upstream), b (upstream-1-self-upstream), c (upstream-1-self-upstream), d (upstream-1-self-upstream), e (upstream-1-self-upstream), f (upstream-1-self-upstream), g (upstream-1-self-upstream), h (upstream-1-self-upstream), b (complex), c (complex), d (complex), e (complex), f (complex), g (complex), h (complex) +", + "[ log] -------------------------------------------------- +", + "[ log] Cluster 1: +", + "[ log] - Dependencies: none +", + "[ log] - Clustered by: - (i (no-deps)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" -- Operations: i (no-deps), i (upstream-self) --------------------------------------------------- -Cluster 2: -- Dependencies: none -- Clustered by: +", + "[ log] - Operations: i (no-deps), i (upstream-self) +", + "[ log] -------------------------------------------------- +", + "[ log] Cluster 2: +", + "[ log] - Dependencies: none +", + "[ log] - Clustered by: - (j (no-deps)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" -- Operations: j (no-deps), j (upstream-self) --------------------------------------------------- -Cluster 3: -- Dependencies: none -- Clustered by: +", + "[ log] - Operations: j (no-deps), j (upstream-self) +", + "[ log] -------------------------------------------------- +", + "[ log] Cluster 3: +", + "[ log] - Dependencies: none +", + "[ log] - Clustered by: - (i (upstream-1)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" -- Operations: i (upstream-1), i (upstream-1-self) --------------------------------------------------- -Cluster 4: -- Dependencies: none -- Clustered by: +", + "[ log] - Operations: i (upstream-1), i (upstream-1-self) +", + "[ log] -------------------------------------------------- +", + "[ log] Cluster 4: +", + "[ log] - Dependencies: none +", + "[ log] - Clustered by: - (j (upstream-1)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" -- Operations: j (upstream-1), j (upstream-1-self) --------------------------------------------------- -Cluster 5: -- Dependencies: none -- Clustered by: +", + "[ log] - Operations: j (upstream-1), j (upstream-1-self) +", + "[ log] -------------------------------------------------- +", + "[ log] Cluster 5: +", + "[ log] - Dependencies: none +", + "[ log] - Clustered by: - (i (upstream-2)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" -- Operations: i (upstream-2), i (upstream-2-self) --------------------------------------------------- -Cluster 6: -- Dependencies: none -- Clustered by: +", + "[ log] - Operations: i (upstream-2), i (upstream-2-self) +", + "[ log] -------------------------------------------------- +", + "[ log] Cluster 6: +", + "[ log] - Dependencies: none +", + "[ log] - Clustered by: - (j (upstream-2)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" -- Operations: j (upstream-2), j (upstream-2-self) --------------------------------------------------- -Cluster 7: -- Dependencies: none -- Clustered by: +", + "[ log] - Operations: j (upstream-2), j (upstream-2-self) +", + "[ log] -------------------------------------------------- +", + "[ log] Cluster 7: +", + "[ log] - Dependencies: none +", + "[ log] - Clustered by: - (a (upstream-3)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" -- Operations: a (upstream-3), a (complex) --------------------------------------------------- -Cluster 8: -- Dependencies: none -- Clustered by: +", + "[ log] - Operations: a (upstream-3), a (complex) +", + "[ log] -------------------------------------------------- +", + "[ log] Cluster 8: +", + "[ log] - Dependencies: none +", + "[ log] - Clustered by: - (i (upstream-3)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" -- Operations: i (upstream-3), i (complex) --------------------------------------------------- -Cluster 9: -- Dependencies: none -- Clustered by: +", + "[ log] - Operations: i (upstream-3), i (complex) +", + "[ log] -------------------------------------------------- +", + "[ log] Cluster 9: +", + "[ log] - Dependencies: none +", + "[ log] - Clustered by: - (j (upstream-3)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" -- Operations: j (upstream-3), j (complex) --------------------------------------------------- -Cluster 10: -- Dependencies: none -- Operations: i (upstream-1-self-upstream) --------------------------------------------------- -Cluster 11: -- Dependencies: none -- Operations: j (upstream-1-self-upstream) --------------------------------------------------- -################################################## -", -} +", + "[ log] - Operations: j (upstream-3), j (complex) +", + "[ log] -------------------------------------------------- +", + "[ log] Cluster 10: +", + "[ log] - Dependencies: none +", + "[ log] - Operations: i (upstream-1-self-upstream) +", + "[ log] -------------------------------------------------- +", + "[ log] Cluster 11: +", + "[ log] - Dependencies: none +", + "[ log] - Operations: j (upstream-1-self-upstream) +", + "[ log] -------------------------------------------------- +", + "[ log] ################################################## +", +] `; diff --git a/libraries/rush-lib/src/logic/operations/test/__snapshots__/OperationMetadataManager.test.ts.snap b/libraries/rush-lib/src/logic/operations/test/__snapshots__/OperationMetadataManager.test.ts.snap index 3c855cf2b6..01ae0ceb12 100644 --- a/libraries/rush-lib/src/logic/operations/test/__snapshots__/OperationMetadataManager.test.ts.snap +++ b/libraries/rush-lib/src/logic/operations/test/__snapshots__/OperationMetadataManager.test.ts.snap @@ -10,20 +10,22 @@ Array [ `; exports[`OperationMetadataManager should restore chunked stderr 1`] = ` -Object { - "error": "chunk1[n]chunk2[n]", -} +Array [ + "[ error] chunk1[n]", + "[ error] chunk2[n]", +] `; exports[`OperationMetadataManager should restore chunked stdout 1`] = ` -Object { - "log": "chunk1[n]chunk2[n]", -} +Array [ + "[ log] chunk1[n]", + "[ log] chunk2[n]", +] `; exports[`OperationMetadataManager should restore mixed chunked output 1`] = ` -Object { - "error": "logged to stderr[n]", - "log": "logged to stdout[n]", -} +Array [ + "[ log] logged to stdout[n]", + "[ error] logged to stderr[n]", +] `; diff --git a/libraries/rush-lib/src/logic/pnpm/test/PnpmShrinkwrapFile.test.ts b/libraries/rush-lib/src/logic/pnpm/test/PnpmShrinkwrapFile.test.ts index 4e2ea90ab6..3a8926cd94 100644 --- a/libraries/rush-lib/src/logic/pnpm/test/PnpmShrinkwrapFile.test.ts +++ b/libraries/rush-lib/src/logic/pnpm/test/PnpmShrinkwrapFile.test.ts @@ -546,7 +546,9 @@ snapshots: terminal ) ).toThrowError(AlreadyReportedError); - expect(terminalProvider.getAllOutput(true)).toMatchSnapshot(); + expect( + terminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true }) + ).toMatchSnapshot(); }); }); }); diff --git a/libraries/rush-lib/src/logic/pnpm/test/__snapshots__/PnpmShrinkwrapFile.test.ts.snap b/libraries/rush-lib/src/logic/pnpm/test/__snapshots__/PnpmShrinkwrapFile.test.ts.snap index 490c95cfc4..1872e08ff2 100644 --- a/libraries/rush-lib/src/logic/pnpm/test/__snapshots__/PnpmShrinkwrapFile.test.ts.snap +++ b/libraries/rush-lib/src/logic/pnpm/test/__snapshots__/PnpmShrinkwrapFile.test.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`PnpmShrinkwrapFile Check is workspace project modified pnpm lockfile major version 9 sha1 integrity can be handled when disallowInsecureSha1 1`] = ` -Object { - "error": "Error: An integrity field with \\"sha1\\" was detected in the pnpm-lock.yaml file located in subspace default; this conflicts with the \\"disallowInsecureSha1\\" policy from pnpm-config.json.[n][n]", -} +Array [ + "[ error] Error: An integrity field with \\"sha1\\" was detected in the pnpm-lock.yaml file located in subspace default; this conflicts with the \\"disallowInsecureSha1\\" policy from pnpm-config.json.[n][n]", +] `; diff --git a/libraries/rush-lib/src/logic/test/InstallHelpers.test.ts b/libraries/rush-lib/src/logic/test/InstallHelpers.test.ts index e299e9ca84..8d8575cb6d 100644 --- a/libraries/rush-lib/src/logic/test/InstallHelpers.test.ts +++ b/libraries/rush-lib/src/logic/test/InstallHelpers.test.ts @@ -25,9 +25,13 @@ describe('InstallHelpers', () => { }); afterEach(() => { - expect(terminalProvider.getAllOutput(true, { normalizeSpecialCharacters: true })).toMatchSnapshot( - 'Terminal Output' - ); + expect( + terminalProvider.getAllOutputAsChunks({ + normalizeSpecialCharacters: true, + asFlat: true, + severityAsNames: true + }) + ).toMatchSnapshot('Terminal Output'); mockJsonFileSave.mockClear(); }); diff --git a/libraries/rush-lib/src/logic/test/ProjectImpactGraphGenerator.test.ts b/libraries/rush-lib/src/logic/test/ProjectImpactGraphGenerator.test.ts index c5ff1d2c73..e269a581ac 100644 --- a/libraries/rush-lib/src/logic/test/ProjectImpactGraphGenerator.test.ts +++ b/libraries/rush-lib/src/logic/test/ProjectImpactGraphGenerator.test.ts @@ -22,9 +22,13 @@ async function runTestForExampleRepoAsync( const generator: ProjectImpactGraphGenerator = new ProjectImpactGraphGenerator(terminal, rushConfiguration); await testFn(generator); - expect(terminalProvider.getAllOutput(true, { normalizeSpecialCharacters: true })).toMatchSnapshot( - 'Terminal Output' - ); + expect( + terminalProvider.getAllOutputAsChunks({ + normalizeSpecialCharacters: true, + asFlat: true, + severityAsNames: true + }) + ).toMatchSnapshot('Terminal Output'); } describe(ProjectImpactGraphGenerator.name, () => { diff --git a/libraries/rush-lib/src/logic/test/__snapshots__/InstallHelpers.test.ts.snap b/libraries/rush-lib/src/logic/test/__snapshots__/InstallHelpers.test.ts.snap index 12d290aeb6..99720df132 100644 --- a/libraries/rush-lib/src/logic/test/__snapshots__/InstallHelpers.test.ts.snap +++ b/libraries/rush-lib/src/logic/test/__snapshots__/InstallHelpers.test.ts.snap @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`InstallHelpers generateCommonPackageJson generates correct package json with pnpm configurations: Terminal Output 1`] = `Object {}`; +exports[`InstallHelpers generateCommonPackageJson generates correct package json with pnpm configurations: Terminal Output 1`] = `Array []`; diff --git a/libraries/rush-lib/src/logic/test/__snapshots__/ProjectImpactGraphGenerator.test.ts.snap b/libraries/rush-lib/src/logic/test/__snapshots__/ProjectImpactGraphGenerator.test.ts.snap index 73d78358b5..3aaa6fe9db 100644 --- a/libraries/rush-lib/src/logic/test/__snapshots__/ProjectImpactGraphGenerator.test.ts.snap +++ b/libraries/rush-lib/src/logic/test/__snapshots__/ProjectImpactGraphGenerator.test.ts.snap @@ -92,9 +92,10 @@ projects: exports[`ProjectImpactGraphGenerator generateAsync Correctly generates a project impact graph (repo: ""packages""): Output file path 1`] = `"/project-impact-graph.yaml"`; exports[`ProjectImpactGraphGenerator generateAsync Correctly generates a project impact graph (repo: ""packages""): Terminal Output 1`] = ` -Object { - "log": "[n][green]Generate project impact graph successfully. (1.50 seconds)[default][n]", -} +Array [ + "[ log] [n]", + "[ log] [green]Generate project impact graph successfully. (1.50 seconds)[default][n]", +] `; exports[`ProjectImpactGraphGenerator generateAsync Correctly generates a project impact graph (repo: ""repo""): Output file data 1`] = ` @@ -165,9 +166,10 @@ projects: exports[`ProjectImpactGraphGenerator generateAsync Correctly generates a project impact graph (repo: ""repo""): Output file path 1`] = `"/project-impact-graph.yaml"`; exports[`ProjectImpactGraphGenerator generateAsync Correctly generates a project impact graph (repo: ""repo""): Terminal Output 1`] = ` -Object { - "log": "[n][green]Generate project impact graph successfully. (1.50 seconds)[default][n]", -} +Array [ + "[ log] [n]", + "[ log] [green]Generate project impact graph successfully. (1.50 seconds)[default][n]", +] `; exports[`ProjectImpactGraphGenerator generateAsync Correctly generates a project impact graph (repo: ""workspacePackages""): Output file data 1`] = ` @@ -264,9 +266,10 @@ projects: exports[`ProjectImpactGraphGenerator generateAsync Correctly generates a project impact graph (repo: ""workspacePackages""): Output file path 1`] = `"/project-impact-graph.yaml"`; exports[`ProjectImpactGraphGenerator generateAsync Correctly generates a project impact graph (repo: ""workspacePackages""): Terminal Output 1`] = ` -Object { - "log": "[n][green]Generate project impact graph successfully. (1.50 seconds)[default][n]", -} +Array [ + "[ log] [n]", + "[ log] [green]Generate project impact graph successfully. (1.50 seconds)[default][n]", +] `; -exports[`ProjectImpactGraphGenerator validateAsync Reports if the project-impact-graph.yaml file is missing (repo: ""workspacePackages""): Terminal Output 1`] = `Object {}`; +exports[`ProjectImpactGraphGenerator validateAsync Reports if the project-impact-graph.yaml file is missing (repo: ""workspacePackages""): Terminal Output 1`] = `Array []`; diff --git a/libraries/terminal/src/test/PrefixProxyTerminalProvider.test.ts b/libraries/terminal/src/test/PrefixProxyTerminalProvider.test.ts index e42c7da62c..bc8c88b27c 100644 --- a/libraries/terminal/src/test/PrefixProxyTerminalProvider.test.ts +++ b/libraries/terminal/src/test/PrefixProxyTerminalProvider.test.ts @@ -13,7 +13,10 @@ function runTestsForTerminalProvider( let baseProvider: StringBufferTerminalProvider; function verifyProvider(): void { - expect(baseProvider.getAllOutput(true)).toMatchSnapshot(); + expect(baseProvider.getAllOutput(true)).toMatchSnapshot('output'); + expect(baseProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true })).toMatchSnapshot( + 'output as chunks' + ); } beforeEach(() => { diff --git a/libraries/terminal/src/test/Terminal.test.ts b/libraries/terminal/src/test/Terminal.test.ts index a76fb2e1ef..48f59cc112 100644 --- a/libraries/terminal/src/test/Terminal.test.ts +++ b/libraries/terminal/src/test/Terminal.test.ts @@ -10,7 +10,8 @@ describe(Terminal.name, () => { let provider: StringBufferTerminalProvider; function verifyProvider(): void { - expect(provider.getAllOutput()).toMatchSnapshot(); + expect(provider.getAllOutput()).toMatchSnapshot('output'); + expect(provider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot('output as chunks'); } describe('01 color enabled', () => { diff --git a/libraries/terminal/src/test/TerminalStreamWritable.test.ts b/libraries/terminal/src/test/TerminalStreamWritable.test.ts index ef3fac1808..6e01e82038 100644 --- a/libraries/terminal/src/test/TerminalStreamWritable.test.ts +++ b/libraries/terminal/src/test/TerminalStreamWritable.test.ts @@ -11,7 +11,8 @@ let terminal: Terminal; let provider: StringBufferTerminalProvider; function verifyProvider(): void { - expect(provider.getAllOutput()).toMatchSnapshot(); + expect(provider.getAllOutput()).toMatchSnapshot('output'); + expect(provider.getAllOutputAsChunks({ severityAsNames: true })).toMatchSnapshot('output as chunks'); } async function writeAsync(writable: Writable, data: string): Promise { diff --git a/libraries/terminal/src/test/__snapshots__/PrefixProxyTerminalProvider.test.ts.snap b/libraries/terminal/src/test/__snapshots__/PrefixProxyTerminalProvider.test.ts.snap index 003d1fc8b0..5743691824 100644 --- a/libraries/terminal/src/test/__snapshots__/PrefixProxyTerminalProvider.test.ts.snap +++ b/libraries/terminal/src/test/__snapshots__/PrefixProxyTerminalProvider.test.ts.snap @@ -1,109 +1,259 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`PrefixProxyTerminalProvider With a dynamic prefix write writes a message 1`] = ` +exports[`PrefixProxyTerminalProvider With a dynamic prefix write writes a message with newlines: output 1`] = ` Object { - "log": "[prefix (0)] test message", + "log": "[prefix (0)] message 1[n][prefix (1)] message 2[n][prefix (2)] message 3", } `; -exports[`PrefixProxyTerminalProvider With a dynamic prefix write writes a message with newlines 1`] = ` +exports[`PrefixProxyTerminalProvider With a dynamic prefix write writes a message with newlines: output as chunks 1`] = ` +Array [ + "[ log] [prefix (0)] message 1[n]", + "[ log] [prefix (1)] message 2[n]", + "[ log] [prefix (2)] message 3", +] +`; + +exports[`PrefixProxyTerminalProvider With a dynamic prefix write writes a message with provider newlines: output 1`] = ` Object { "log": "[prefix (0)] message 1[n][prefix (1)] message 2[n][prefix (2)] message 3", } `; -exports[`PrefixProxyTerminalProvider With a dynamic prefix write writes a message with provider newlines 1`] = ` +exports[`PrefixProxyTerminalProvider With a dynamic prefix write writes a message with provider newlines: output as chunks 1`] = ` +Array [ + "[ log] [prefix (0)] message 1[n]", + "[ log] [prefix (1)] message 2[n]", + "[ log] [prefix (2)] message 3", +] +`; + +exports[`PrefixProxyTerminalProvider With a dynamic prefix write writes a message: output 1`] = ` Object { - "log": "[prefix (0)] message 1[n][prefix (1)] message 2[n][prefix (2)] message 3", + "log": "[prefix (0)] test message", } `; -exports[`PrefixProxyTerminalProvider With a dynamic prefix write writes a mix of messages with and without newlines 1`] = ` +exports[`PrefixProxyTerminalProvider With a dynamic prefix write writes a message: output as chunks 1`] = ` +Array [ + "[ log] [prefix (0)] test message", +] +`; + +exports[`PrefixProxyTerminalProvider With a dynamic prefix write writes a mix of messages with and without newlines: output 1`] = ` Object { "log": "[prefix (0)] message 1message 2[n][prefix (1)] message 3[n][prefix (2)] message 4message 5[n][prefix (3)] message 6", } `; -exports[`PrefixProxyTerminalProvider With a dynamic prefix write writes messages without newlines 1`] = ` +exports[`PrefixProxyTerminalProvider With a dynamic prefix write writes a mix of messages with and without newlines: output as chunks 1`] = ` +Array [ + "[ log] [prefix (0)] message 1", + "[ log] message 2[n]", + "[ log] [prefix (1)] message 3[n]", + "[ log] [prefix (2)] message 4", + "[ log] message 5[n]", + "[ log] [prefix (3)] message 6", +] +`; + +exports[`PrefixProxyTerminalProvider With a dynamic prefix write writes messages without newlines: output 1`] = ` Object { "log": "[prefix (0)] message 1message 2message 3", } `; -exports[`PrefixProxyTerminalProvider With a dynamic prefix writeLine writes a message line 1`] = ` +exports[`PrefixProxyTerminalProvider With a dynamic prefix write writes messages without newlines: output as chunks 1`] = ` +Array [ + "[ log] [prefix (0)] message 1", + "[ log] message 2", + "[ log] message 3", +] +`; + +exports[`PrefixProxyTerminalProvider With a dynamic prefix writeLine writes a message line with newlines: output 1`] = ` Object { - "log": "[prefix (0)] test message[n]", + "log": "[prefix (0)] message 1[n][prefix (1)] message 2[n][prefix (2)] message 3[n]", } `; -exports[`PrefixProxyTerminalProvider With a dynamic prefix writeLine writes a message line with newlines 1`] = ` +exports[`PrefixProxyTerminalProvider With a dynamic prefix writeLine writes a message line with newlines: output as chunks 1`] = ` +Array [ + "[ log] [prefix (0)] message 1[n]", + "[ log] [prefix (1)] message 2[n]", + "[ log] [prefix (2)] message 3[n]", +] +`; + +exports[`PrefixProxyTerminalProvider With a dynamic prefix writeLine writes a message line with provider newlines: output 1`] = ` Object { "log": "[prefix (0)] message 1[n][prefix (1)] message 2[n][prefix (2)] message 3[n]", } `; -exports[`PrefixProxyTerminalProvider With a dynamic prefix writeLine writes a message line with provider newlines 1`] = ` +exports[`PrefixProxyTerminalProvider With a dynamic prefix writeLine writes a message line with provider newlines: output as chunks 1`] = ` +Array [ + "[ log] [prefix (0)] message 1[n]", + "[ log] [prefix (1)] message 2[n]", + "[ log] [prefix (2)] message 3[n]", +] +`; + +exports[`PrefixProxyTerminalProvider With a dynamic prefix writeLine writes a message line: output 1`] = ` Object { - "log": "[prefix (0)] message 1[n][prefix (1)] message 2[n][prefix (2)] message 3[n]", + "log": "[prefix (0)] test message[n]", } `; -exports[`PrefixProxyTerminalProvider With a dynamic prefix writeLine writes a mix of message lines with and without newlines 1`] = ` +exports[`PrefixProxyTerminalProvider With a dynamic prefix writeLine writes a message line: output as chunks 1`] = ` +Array [ + "[ log] [prefix (0)] test message[n]", +] +`; + +exports[`PrefixProxyTerminalProvider With a dynamic prefix writeLine writes a mix of message lines with and without newlines: output 1`] = ` Object { "log": "[prefix (0)] message 1[n][prefix (1)] message 2[n][prefix (2)] message 3[n][prefix (3)] [n][prefix (4)] message 4[n][prefix (5)] message 5[n][prefix (6)] message 6[n]", } `; -exports[`PrefixProxyTerminalProvider With a static prefix write writes a message 1`] = ` +exports[`PrefixProxyTerminalProvider With a dynamic prefix writeLine writes a mix of message lines with and without newlines: output as chunks 1`] = ` +Array [ + "[ log] [prefix (0)] message 1[n]", + "[ log] [prefix (1)] message 2[n]", + "[ log] [prefix (2)] message 3[n]", + "[ log] [prefix (3)] [n]", + "[ log] [prefix (4)] message 4[n]", + "[ log] [prefix (5)] message 5[n]", + "[ log] [prefix (6)] message 6[n]", +] +`; + +exports[`PrefixProxyTerminalProvider With a static prefix write writes a message with newlines: output 1`] = ` Object { - "log": "[prefix] test message", + "log": "[prefix] message 1[n][prefix] message 2[n][prefix] message 3", } `; -exports[`PrefixProxyTerminalProvider With a static prefix write writes a message with newlines 1`] = ` +exports[`PrefixProxyTerminalProvider With a static prefix write writes a message with newlines: output as chunks 1`] = ` +Array [ + "[ log] [prefix] message 1[n]", + "[ log] [prefix] message 2[n]", + "[ log] [prefix] message 3", +] +`; + +exports[`PrefixProxyTerminalProvider With a static prefix write writes a message with provider newlines: output 1`] = ` Object { "log": "[prefix] message 1[n][prefix] message 2[n][prefix] message 3", } `; -exports[`PrefixProxyTerminalProvider With a static prefix write writes a message with provider newlines 1`] = ` +exports[`PrefixProxyTerminalProvider With a static prefix write writes a message with provider newlines: output as chunks 1`] = ` +Array [ + "[ log] [prefix] message 1[n]", + "[ log] [prefix] message 2[n]", + "[ log] [prefix] message 3", +] +`; + +exports[`PrefixProxyTerminalProvider With a static prefix write writes a message: output 1`] = ` Object { - "log": "[prefix] message 1[n][prefix] message 2[n][prefix] message 3", + "log": "[prefix] test message", } `; -exports[`PrefixProxyTerminalProvider With a static prefix write writes a mix of messages with and without newlines 1`] = ` +exports[`PrefixProxyTerminalProvider With a static prefix write writes a message: output as chunks 1`] = ` +Array [ + "[ log] [prefix] test message", +] +`; + +exports[`PrefixProxyTerminalProvider With a static prefix write writes a mix of messages with and without newlines: output 1`] = ` Object { "log": "[prefix] message 1message 2[n][prefix] message 3[n][prefix] message 4message 5[n][prefix] message 6", } `; -exports[`PrefixProxyTerminalProvider With a static prefix write writes messages without newlines 1`] = ` +exports[`PrefixProxyTerminalProvider With a static prefix write writes a mix of messages with and without newlines: output as chunks 1`] = ` +Array [ + "[ log] [prefix] message 1", + "[ log] message 2[n]", + "[ log] [prefix] message 3[n]", + "[ log] [prefix] message 4", + "[ log] message 5[n]", + "[ log] [prefix] message 6", +] +`; + +exports[`PrefixProxyTerminalProvider With a static prefix write writes messages without newlines: output 1`] = ` Object { "log": "[prefix] message 1message 2message 3", } `; -exports[`PrefixProxyTerminalProvider With a static prefix writeLine writes a message line 1`] = ` +exports[`PrefixProxyTerminalProvider With a static prefix write writes messages without newlines: output as chunks 1`] = ` +Array [ + "[ log] [prefix] message 1", + "[ log] message 2", + "[ log] message 3", +] +`; + +exports[`PrefixProxyTerminalProvider With a static prefix writeLine writes a message line with newlines: output 1`] = ` Object { - "log": "[prefix] test message[n]", + "log": "[prefix] message 1[n][prefix] message 2[n][prefix] message 3[n]", } `; -exports[`PrefixProxyTerminalProvider With a static prefix writeLine writes a message line with newlines 1`] = ` +exports[`PrefixProxyTerminalProvider With a static prefix writeLine writes a message line with newlines: output as chunks 1`] = ` +Array [ + "[ log] [prefix] message 1[n]", + "[ log] [prefix] message 2[n]", + "[ log] [prefix] message 3[n]", +] +`; + +exports[`PrefixProxyTerminalProvider With a static prefix writeLine writes a message line with provider newlines: output 1`] = ` Object { "log": "[prefix] message 1[n][prefix] message 2[n][prefix] message 3[n]", } `; -exports[`PrefixProxyTerminalProvider With a static prefix writeLine writes a message line with provider newlines 1`] = ` +exports[`PrefixProxyTerminalProvider With a static prefix writeLine writes a message line with provider newlines: output as chunks 1`] = ` +Array [ + "[ log] [prefix] message 1[n]", + "[ log] [prefix] message 2[n]", + "[ log] [prefix] message 3[n]", +] +`; + +exports[`PrefixProxyTerminalProvider With a static prefix writeLine writes a message line: output 1`] = ` Object { - "log": "[prefix] message 1[n][prefix] message 2[n][prefix] message 3[n]", + "log": "[prefix] test message[n]", } `; -exports[`PrefixProxyTerminalProvider With a static prefix writeLine writes a mix of message lines with and without newlines 1`] = ` +exports[`PrefixProxyTerminalProvider With a static prefix writeLine writes a message line: output as chunks 1`] = ` +Array [ + "[ log] [prefix] test message[n]", +] +`; + +exports[`PrefixProxyTerminalProvider With a static prefix writeLine writes a mix of message lines with and without newlines: output 1`] = ` Object { "log": "[prefix] message 1[n][prefix] message 2[n][prefix] message 3[n][prefix] [n][prefix] message 4[n][prefix] message 5[n][prefix] message 6[n]", } `; + +exports[`PrefixProxyTerminalProvider With a static prefix writeLine writes a mix of message lines with and without newlines: output as chunks 1`] = ` +Array [ + "[ log] [prefix] message 1[n]", + "[ log] [prefix] message 2[n]", + "[ log] [prefix] message 3[n]", + "[ log] [prefix] [n]", + "[ log] [prefix] message 4[n]", + "[ log] [prefix] message 5[n]", + "[ log] [prefix] message 6[n]", +] +`; diff --git a/libraries/terminal/src/test/__snapshots__/Terminal.test.ts.snap b/libraries/terminal/src/test/__snapshots__/Terminal.test.ts.snap index 6ba14641d2..92c62bdff5 100644 --- a/libraries/terminal/src/test/__snapshots__/Terminal.test.ts.snap +++ b/libraries/terminal/src/test/__snapshots__/Terminal.test.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Terminal 01 color enabled 01 basic terminal functions 01 write 01 writes a single message 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 01 write 01 writes a single message: output 1`] = ` Object { "debug": "", "error": "", @@ -10,7 +10,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 01 write 02 writes multiple messages 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 01 write 01 writes a single message: output as chunks 1`] = ` +Array [ + "[0] test message", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 01 write 02 writes multiple messages: output 1`] = ` Object { "debug": "", "error": "", @@ -20,7 +26,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 01 write 03 writes a message with colors 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 01 write 02 writes multiple messages: output as chunks 1`] = ` +Array [ + "[0] message 1message 2", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 01 write 03 writes a message with colors: output 1`] = ` Object { "debug": "", "error": "", @@ -30,7 +42,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 01 write 04 writes a multiple messages with colors 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 01 write 03 writes a message with colors: output as chunks 1`] = ` +Array [ + "[0] [green]message 1[default]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 01 write 04 writes a multiple messages with colors: output 1`] = ` Object { "debug": "", "error": "", @@ -40,7 +58,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 01 write 05 writes a messages with colors interspersed with non-colored messages 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 01 write 04 writes a multiple messages with colors: output as chunks 1`] = ` +Array [ + "[0] [green]message 1[default][red]message 2[default]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 01 write 05 writes a messages with colors interspersed with non-colored messages: output 1`] = ` Object { "debug": "", "error": "", @@ -50,7 +74,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 01 write 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 01 write 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` +Array [ + "[0] message 1[green]message 2[default]message 3[red]message 4[default]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 01 write 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output 1`] = ` Object { "debug": "", "error": "", @@ -60,7 +90,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 01 writes a single message 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 01 write 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` +Array [ + "[0] message 1[green]message 2[default]message 3[red]message 4[default]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 01 writes a single message: output 1`] = ` Object { "debug": "", "error": "", @@ -70,7 +106,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 02 writes multiple messages 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 01 writes a single message: output as chunks 1`] = ` +Array [ + "[0] test message[n]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 02 writes multiple messages: output 1`] = ` Object { "debug": "", "error": "", @@ -80,7 +122,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 03 writes a message with colors 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 02 writes multiple messages: output as chunks 1`] = ` +Array [ + "[0] message 1message 2[n]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 03 writes a message with colors: output 1`] = ` Object { "debug": "", "error": "", @@ -90,7 +138,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 04 writes a multiple messages with colors 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 03 writes a message with colors: output as chunks 1`] = ` +Array [ + "[0] [green]message 1[default][n]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 04 writes a multiple messages with colors: output 1`] = ` Object { "debug": "", "error": "", @@ -100,7 +154,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 05 writes a messages with colors interspersed with non-colored messages 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 04 writes a multiple messages with colors: output as chunks 1`] = ` +Array [ + "[0] [green]message 1[default][red]message 2[default][n]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 05 writes a messages with colors interspersed with non-colored messages: output 1`] = ` Object { "debug": "", "error": "", @@ -110,7 +170,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` +Array [ + "[0] message 1[green]message 2[default]message 3[red]message 4[default][n]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output 1`] = ` Object { "debug": "", "error": "", @@ -120,7 +186,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 03 writeWarning 01 writes a single message 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` +Array [ + "[0] message 1[green]message 2[default]message 3[red]message 4[default][n]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 03 writeWarning 01 writes a single message: output 1`] = ` Object { "debug": "", "error": "", @@ -130,7 +202,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 03 writeWarning 02 writes multiple messages 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 03 writeWarning 01 writes a single message: output as chunks 1`] = ` +Array [ + "[1] [yellow]test message[default]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 03 writeWarning 02 writes multiple messages: output 1`] = ` Object { "debug": "", "error": "", @@ -140,7 +218,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 03 writeWarning 03 writes a message with colors 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 03 writeWarning 02 writes multiple messages: output as chunks 1`] = ` +Array [ + "[1] [yellow]message 1[default][yellow]message 2[default]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 03 writeWarning 03 writes a message with colors: output 1`] = ` Object { "debug": "", "error": "", @@ -150,7 +234,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 03 writeWarning 04 writes a multiple messages with colors 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 03 writeWarning 03 writes a message with colors: output as chunks 1`] = ` +Array [ + "[1] [yellow]message 1[default]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 03 writeWarning 04 writes a multiple messages with colors: output 1`] = ` Object { "debug": "", "error": "", @@ -160,7 +250,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 03 writeWarning 05 writes a messages with colors interspersed with non-colored messages 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 03 writeWarning 04 writes a multiple messages with colors: output as chunks 1`] = ` +Array [ + "[1] [yellow]message 1[default][yellow]message 2[default]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 03 writeWarning 05 writes a messages with colors interspersed with non-colored messages: output 1`] = ` Object { "debug": "", "error": "", @@ -170,7 +266,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 03 writeWarning 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 03 writeWarning 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` +Array [ + "[1] [yellow]message 1[default][yellow]message 2[default][yellow]message 3[default][yellow]message 4[default]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 03 writeWarning 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output 1`] = ` Object { "debug": "", "error": "", @@ -180,7 +282,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 01 writes a single message 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 03 writeWarning 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` +Array [ + "[1] message 1[green]message 2[default]message 3[red]message 4[default]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 01 writes a single message: output 1`] = ` Object { "debug": "", "error": "", @@ -190,7 +298,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 02 writes multiple messages 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 01 writes a single message: output as chunks 1`] = ` +Array [ + "[1] [yellow]test message[default][n]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 02 writes multiple messages: output 1`] = ` Object { "debug": "", "error": "", @@ -200,7 +314,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 03 writes a message with colors 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 02 writes multiple messages: output as chunks 1`] = ` +Array [ + "[1] [yellow]message 1[default][yellow]message 2[default][n]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 03 writes a message with colors: output 1`] = ` Object { "debug": "", "error": "", @@ -210,7 +330,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 04 writes a multiple messages with colors 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 03 writes a message with colors: output as chunks 1`] = ` +Array [ + "[1] [yellow]message 1[default][n]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 04 writes a multiple messages with colors: output 1`] = ` Object { "debug": "", "error": "", @@ -220,7 +346,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 05 writes a messages with colors interspersed with non-colored messages 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 04 writes a multiple messages with colors: output as chunks 1`] = ` +Array [ + "[1] [yellow]message 1[default][yellow]message 2[default][n]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 05 writes a messages with colors interspersed with non-colored messages: output 1`] = ` Object { "debug": "", "error": "", @@ -230,7 +362,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` +Array [ + "[1] [yellow]message 1[default][yellow]message 2[default][yellow]message 3[default][yellow]message 4[default][n]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output 1`] = ` Object { "debug": "", "error": "", @@ -240,7 +378,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 05 writeError 01 writes a single message 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` +Array [ + "[1] message 1[green]message 2[default]message 3[red]message 4[default][n]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 05 writeError 01 writes a single message: output 1`] = ` Object { "debug": "", "error": "[red]test message[default]", @@ -250,7 +394,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 05 writeError 02 writes multiple messages 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 05 writeError 01 writes a single message: output as chunks 1`] = ` +Array [ + "[2] [red]test message[default]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 05 writeError 02 writes multiple messages: output 1`] = ` Object { "debug": "", "error": "[red]message 1[default][red]message 2[default]", @@ -260,7 +410,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 05 writeError 03 writes a message with colors 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 05 writeError 02 writes multiple messages: output as chunks 1`] = ` +Array [ + "[2] [red]message 1[default][red]message 2[default]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 05 writeError 03 writes a message with colors: output 1`] = ` Object { "debug": "", "error": "[red]message 1[default]", @@ -270,7 +426,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 05 writeError 04 writes a multiple messages with colors 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 05 writeError 03 writes a message with colors: output as chunks 1`] = ` +Array [ + "[2] [red]message 1[default]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 05 writeError 04 writes a multiple messages with colors: output 1`] = ` Object { "debug": "", "error": "[red]message 1[default][red]message 2[default]", @@ -280,7 +442,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 05 writeError 05 writes a messages with colors interspersed with non-colored messages 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 05 writeError 04 writes a multiple messages with colors: output as chunks 1`] = ` +Array [ + "[2] [red]message 1[default][red]message 2[default]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 05 writeError 05 writes a messages with colors interspersed with non-colored messages: output 1`] = ` Object { "debug": "", "error": "[red]message 1[default][red]message 2[default][red]message 3[default][red]message 4[default]", @@ -290,7 +458,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 05 writeError 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 05 writeError 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` +Array [ + "[2] [red]message 1[default][red]message 2[default][red]message 3[default][red]message 4[default]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 05 writeError 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output 1`] = ` Object { "debug": "", "error": "message 1[green]message 2[default]message 3[red]message 4[default]", @@ -300,7 +474,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 01 writes a single message 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 05 writeError 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` +Array [ + "[2] message 1[green]message 2[default]message 3[red]message 4[default]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 01 writes a single message: output 1`] = ` Object { "debug": "", "error": "[red]test message[default][n]", @@ -310,7 +490,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 02 writes multiple messages 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 01 writes a single message: output as chunks 1`] = ` +Array [ + "[2] [red]test message[default][n]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 02 writes multiple messages: output 1`] = ` Object { "debug": "", "error": "[red]message 1[default][red]message 2[default][n]", @@ -320,7 +506,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 03 writes a message with colors 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 02 writes multiple messages: output as chunks 1`] = ` +Array [ + "[2] [red]message 1[default][red]message 2[default][n]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 03 writes a message with colors: output 1`] = ` Object { "debug": "", "error": "[red]message 1[default][n]", @@ -330,7 +522,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 04 writes a multiple messages with colors 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 03 writes a message with colors: output as chunks 1`] = ` +Array [ + "[2] [red]message 1[default][n]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 04 writes a multiple messages with colors: output 1`] = ` Object { "debug": "", "error": "[red]message 1[default][red]message 2[default][n]", @@ -340,7 +538,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 05 writes a messages with colors interspersed with non-colored messages 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 04 writes a multiple messages with colors: output as chunks 1`] = ` +Array [ + "[2] [red]message 1[default][red]message 2[default][n]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 05 writes a messages with colors interspersed with non-colored messages: output 1`] = ` Object { "debug": "", "error": "[red]message 1[default][red]message 2[default][red]message 3[default][red]message 4[default][n]", @@ -350,7 +554,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` +Array [ + "[2] [red]message 1[default][red]message 2[default][red]message 3[default][red]message 4[default][n]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output 1`] = ` Object { "debug": "", "error": "message 1[green]message 2[default]message 3[red]message 4[default][n]", @@ -360,7 +570,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 07 writeVerbose 01 writes a single message 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` +Array [ + "[2] message 1[green]message 2[default]message 3[red]message 4[default][n]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 07 writeVerbose 01 writes a single message: output 1`] = ` Object { "debug": "", "error": "", @@ -370,7 +586,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 07 writeVerbose 02 writes multiple messages 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 07 writeVerbose 01 writes a single message: output as chunks 1`] = ` +Array [ + "[3] test message", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 07 writeVerbose 02 writes multiple messages: output 1`] = ` Object { "debug": "", "error": "", @@ -380,7 +602,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 07 writeVerbose 03 writes a message with colors 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 07 writeVerbose 02 writes multiple messages: output as chunks 1`] = ` +Array [ + "[3] message 1message 2", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 07 writeVerbose 03 writes a message with colors: output 1`] = ` Object { "debug": "", "error": "", @@ -390,7 +618,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 07 writeVerbose 04 writes a multiple messages with colors 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 07 writeVerbose 03 writes a message with colors: output as chunks 1`] = ` +Array [ + "[3] [green]message 1[default]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 07 writeVerbose 04 writes a multiple messages with colors: output 1`] = ` Object { "debug": "", "error": "", @@ -400,7 +634,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 07 writeVerbose 05 writes a messages with colors interspersed with non-colored messages 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 07 writeVerbose 04 writes a multiple messages with colors: output as chunks 1`] = ` +Array [ + "[3] [green]message 1[default][red]message 2[default]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 07 writeVerbose 05 writes a messages with colors interspersed with non-colored messages: output 1`] = ` Object { "debug": "", "error": "", @@ -410,7 +650,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 07 writeVerbose 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 07 writeVerbose 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` +Array [ + "[3] message 1[green]message 2[default]message 3[red]message 4[default]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 07 writeVerbose 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output 1`] = ` Object { "debug": "", "error": "", @@ -420,7 +666,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 01 writes a single message 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 07 writeVerbose 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` +Array [ + "[3] message 1[green]message 2[default]message 3[red]message 4[default]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 01 writes a single message: output 1`] = ` Object { "debug": "", "error": "", @@ -430,7 +682,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 02 writes multiple messages 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 01 writes a single message: output as chunks 1`] = ` +Array [ + "[3] test message[n]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 02 writes multiple messages: output 1`] = ` Object { "debug": "", "error": "", @@ -440,7 +698,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 03 writes a message with colors 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 02 writes multiple messages: output as chunks 1`] = ` +Array [ + "[3] message 1message 2[n]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 03 writes a message with colors: output 1`] = ` Object { "debug": "", "error": "", @@ -450,7 +714,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 04 writes a multiple messages with colors 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 03 writes a message with colors: output as chunks 1`] = ` +Array [ + "[3] [green]message 1[default][n]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 04 writes a multiple messages with colors: output 1`] = ` Object { "debug": "", "error": "", @@ -460,7 +730,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 05 writes a messages with colors interspersed with non-colored messages 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 04 writes a multiple messages with colors: output as chunks 1`] = ` +Array [ + "[3] [green]message 1[default][red]message 2[default][n]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 05 writes a messages with colors interspersed with non-colored messages: output 1`] = ` Object { "debug": "", "error": "", @@ -470,7 +746,13 @@ Object { } `; -exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` +Array [ + "[3] message 1[green]message 2[default]message 3[red]message 4[default][n]", +] +`; + +exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output 1`] = ` Object { "debug": "", "error": "", @@ -480,7 +762,13 @@ Object { } `; -exports[`Terminal 01 color enabled 05 writes to multiple streams 1`] = ` +exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` +Array [ + "[3] message 1[green]message 2[default]message 3[red]message 4[default][n]", +] +`; + +exports[`Terminal 01 color enabled 05 writes to multiple streams: output 1`] = ` Object { "debug": "", "error": "[red]message 1[default][red]message 2[default][red]message 3[default][red]message 4[default][red]test message[default][n][red]message 1[default][red]message 2[default][red]message 1[default][red]message 2[default][n][red]message 1[default][red]message 1[default][red]message 2[default][red]message 3[default][red]message 4[default][n][red]message 1[default][n][red]test message[default][red]message 1[default][red]message 2[default][n][red]message 1[default][red]message 2[default]", @@ -490,7 +778,51 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 01 write 01 writes a single message 1`] = ` +exports[`Terminal 01 color enabled 05 writes to multiple streams: output as chunks 1`] = ` +Array [ + "[0] message 1[green]message 2[default]message 3[red]message 4[default]", + "[1] [yellow]message 1[default][yellow]message 2[default][n]", + "[3] test message", + "[3] [green]message 1[default]", + "[0] [green]message 1[default][n]", + "[2] [red]message 1[default][red]message 2[default][red]message 3[default][red]message 4[default]", + "[2] [red]test message[default][n]", + "[3] message 1[green]message 2[default]message 3[red]message 4[default][n]", + "[3] test message[n]", + "[1] [yellow]message 1[default][yellow]message 2[default]", + "[1] [yellow]message 1[default][yellow]message 2[default][yellow]message 3[default][yellow]message 4[default]", + "[2] [red]message 1[default][red]message 2[default]", + "[0] [green]message 1[default]", + "[3] message 1[green]message 2[default]message 3[red]message 4[default]", + "[2] [red]message 1[default][red]message 2[default][n]", + "[0] [green]message 1[default][red]message 2[default]", + "[3] message 1message 2", + "[3] [green]message 1[default][n]", + "[0] [green]message 1[default][red]message 2[default][n]", + "[2] [red]message 1[default]", + "[1] [yellow]message 1[default][yellow]message 2[default][yellow]message 3[default][yellow]message 4[default][n]", + "[0] test message", + "[1] [yellow]test message[default][n]", + "[3] [green]message 1[default][red]message 2[default][n]", + "[3] message 1message 2[n]", + "[2] [red]message 1[default][red]message 2[default][red]message 3[default][red]message 4[default][n]", + "[0] message 1[green]message 2[default]message 3[red]message 4[default][n]", + "[1] [yellow]message 1[default][yellow]message 2[default]", + "[2] [red]message 1[default][n]", + "[0] message 1message 2", + "[3] [green]message 1[default][red]message 2[default]", + "[1] [yellow]message 1[default]", + "[0] test message[n]", + "[2] [red]test message[default]", + "[0] message 1message 2[n]", + "[2] [red]message 1[default][red]message 2[default][n]", + "[2] [red]message 1[default][red]message 2[default]", + "[1] [yellow]message 1[default][yellow]message 2[default][n]", + "[1] [yellow]message 1[default][n]", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 01 write 01 writes a single message: output 1`] = ` Object { "debug": "", "error": "", @@ -500,7 +832,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 01 write 02 writes multiple messages 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 01 write 01 writes a single message: output as chunks 1`] = ` +Array [ + "[0] test message", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 01 write 02 writes multiple messages: output 1`] = ` Object { "debug": "", "error": "", @@ -510,7 +848,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 01 write 03 writes a message with colors 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 01 write 02 writes multiple messages: output as chunks 1`] = ` +Array [ + "[0] message 1message 2", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 01 write 03 writes a message with colors: output 1`] = ` Object { "debug": "", "error": "", @@ -520,7 +864,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 01 write 04 writes a multiple messages with colors 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 01 write 03 writes a message with colors: output as chunks 1`] = ` +Array [ + "[0] message 1", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 01 write 04 writes a multiple messages with colors: output 1`] = ` Object { "debug": "", "error": "", @@ -530,7 +880,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 01 write 05 writes a messages with colors interspersed with non-colored messages 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 01 write 04 writes a multiple messages with colors: output as chunks 1`] = ` +Array [ + "[0] message 1message 2", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 01 write 05 writes a messages with colors interspersed with non-colored messages: output 1`] = ` Object { "debug": "", "error": "", @@ -540,7 +896,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 01 write 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 01 write 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` +Array [ + "[0] message 1message 2message 3message 4", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 01 write 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output 1`] = ` Object { "debug": "", "error": "", @@ -550,7 +912,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 01 writes a single message 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 01 write 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` +Array [ + "[0] message 1message 2message 3message 4", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 01 writes a single message: output 1`] = ` Object { "debug": "", "error": "", @@ -560,7 +928,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 02 writes multiple messages 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 01 writes a single message: output as chunks 1`] = ` +Array [ + "[0] test message[n]", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 02 writes multiple messages: output 1`] = ` Object { "debug": "", "error": "", @@ -570,7 +944,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 03 writes a message with colors 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 02 writes multiple messages: output as chunks 1`] = ` +Array [ + "[0] message 1message 2[n]", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 03 writes a message with colors: output 1`] = ` Object { "debug": "", "error": "", @@ -580,7 +960,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 04 writes a multiple messages with colors 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 03 writes a message with colors: output as chunks 1`] = ` +Array [ + "[0] message 1[n]", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 04 writes a multiple messages with colors: output 1`] = ` Object { "debug": "", "error": "", @@ -590,7 +976,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 05 writes a messages with colors interspersed with non-colored messages 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 04 writes a multiple messages with colors: output as chunks 1`] = ` +Array [ + "[0] message 1message 2[n]", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 05 writes a messages with colors interspersed with non-colored messages: output 1`] = ` Object { "debug": "", "error": "", @@ -600,7 +992,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` +Array [ + "[0] message 1message 2message 3message 4[n]", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output 1`] = ` Object { "debug": "", "error": "", @@ -610,7 +1008,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 03 writeWarning 01 writes a single message 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` +Array [ + "[0] message 1message 2message 3message 4[n]", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 03 writeWarning 01 writes a single message: output 1`] = ` Object { "debug": "", "error": "", @@ -620,7 +1024,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 03 writeWarning 02 writes multiple messages 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 03 writeWarning 01 writes a single message: output as chunks 1`] = ` +Array [ + "[1] test message", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 03 writeWarning 02 writes multiple messages: output 1`] = ` Object { "debug": "", "error": "", @@ -630,7 +1040,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 03 writeWarning 03 writes a message with colors 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 03 writeWarning 02 writes multiple messages: output as chunks 1`] = ` +Array [ + "[1] message 1message 2", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 03 writeWarning 03 writes a message with colors: output 1`] = ` Object { "debug": "", "error": "", @@ -640,7 +1056,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 03 writeWarning 04 writes a multiple messages with colors 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 03 writeWarning 03 writes a message with colors: output as chunks 1`] = ` +Array [ + "[1] message 1", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 03 writeWarning 04 writes a multiple messages with colors: output 1`] = ` Object { "debug": "", "error": "", @@ -650,7 +1072,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 03 writeWarning 05 writes a messages with colors interspersed with non-colored messages 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 03 writeWarning 04 writes a multiple messages with colors: output as chunks 1`] = ` +Array [ + "[1] message 1message 2", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 03 writeWarning 05 writes a messages with colors interspersed with non-colored messages: output 1`] = ` Object { "debug": "", "error": "", @@ -660,7 +1088,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 03 writeWarning 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 03 writeWarning 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` +Array [ + "[1] message 1message 2message 3message 4", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 03 writeWarning 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output 1`] = ` Object { "debug": "", "error": "", @@ -670,7 +1104,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 01 writes a single message 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 03 writeWarning 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` +Array [ + "[1] message 1message 2message 3message 4", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 01 writes a single message: output 1`] = ` Object { "debug": "", "error": "", @@ -680,7 +1120,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 02 writes multiple messages 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 01 writes a single message: output as chunks 1`] = ` +Array [ + "[1] test message[n]", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 02 writes multiple messages: output 1`] = ` Object { "debug": "", "error": "", @@ -690,7 +1136,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 03 writes a message with colors 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 02 writes multiple messages: output as chunks 1`] = ` +Array [ + "[1] message 1message 2[n]", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 03 writes a message with colors: output 1`] = ` Object { "debug": "", "error": "", @@ -700,7 +1152,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 04 writes a multiple messages with colors 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 03 writes a message with colors: output as chunks 1`] = ` +Array [ + "[1] message 1[n]", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 04 writes a multiple messages with colors: output 1`] = ` Object { "debug": "", "error": "", @@ -710,7 +1168,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 05 writes a messages with colors interspersed with non-colored messages 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 04 writes a multiple messages with colors: output as chunks 1`] = ` +Array [ + "[1] message 1message 2[n]", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 05 writes a messages with colors interspersed with non-colored messages: output 1`] = ` Object { "debug": "", "error": "", @@ -720,7 +1184,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` +Array [ + "[1] message 1message 2message 3message 4[n]", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output 1`] = ` Object { "debug": "", "error": "", @@ -730,7 +1200,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 05 writeError 01 writes a single message 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` +Array [ + "[1] message 1message 2message 3message 4[n]", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 05 writeError 01 writes a single message: output 1`] = ` Object { "debug": "", "error": "test message", @@ -740,7 +1216,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 05 writeError 02 writes multiple messages 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 05 writeError 01 writes a single message: output as chunks 1`] = ` +Array [ + "[2] test message", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 05 writeError 02 writes multiple messages: output 1`] = ` Object { "debug": "", "error": "message 1message 2", @@ -750,7 +1232,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 05 writeError 03 writes a message with colors 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 05 writeError 02 writes multiple messages: output as chunks 1`] = ` +Array [ + "[2] message 1message 2", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 05 writeError 03 writes a message with colors: output 1`] = ` Object { "debug": "", "error": "message 1", @@ -760,7 +1248,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 05 writeError 04 writes a multiple messages with colors 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 05 writeError 03 writes a message with colors: output as chunks 1`] = ` +Array [ + "[2] message 1", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 05 writeError 04 writes a multiple messages with colors: output 1`] = ` Object { "debug": "", "error": "message 1message 2", @@ -770,7 +1264,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 05 writeError 05 writes a messages with colors interspersed with non-colored messages 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 05 writeError 04 writes a multiple messages with colors: output as chunks 1`] = ` +Array [ + "[2] message 1message 2", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 05 writeError 05 writes a messages with colors interspersed with non-colored messages: output 1`] = ` Object { "debug": "", "error": "message 1message 2message 3message 4", @@ -780,7 +1280,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 05 writeError 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 05 writeError 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` +Array [ + "[2] message 1message 2message 3message 4", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 05 writeError 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output 1`] = ` Object { "debug": "", "error": "message 1message 2message 3message 4", @@ -790,7 +1296,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 01 writes a single message 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 05 writeError 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` +Array [ + "[2] message 1message 2message 3message 4", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 01 writes a single message: output 1`] = ` Object { "debug": "", "error": "test message[n]", @@ -800,7 +1312,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 02 writes multiple messages 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 01 writes a single message: output as chunks 1`] = ` +Array [ + "[2] test message[n]", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 02 writes multiple messages: output 1`] = ` Object { "debug": "", "error": "message 1message 2[n]", @@ -810,7 +1328,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 03 writes a message with colors 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 02 writes multiple messages: output as chunks 1`] = ` +Array [ + "[2] message 1message 2[n]", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 03 writes a message with colors: output 1`] = ` Object { "debug": "", "error": "message 1[n]", @@ -820,7 +1344,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 04 writes a multiple messages with colors 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 03 writes a message with colors: output as chunks 1`] = ` +Array [ + "[2] message 1[n]", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 04 writes a multiple messages with colors: output 1`] = ` Object { "debug": "", "error": "message 1message 2[n]", @@ -830,7 +1360,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 05 writes a messages with colors interspersed with non-colored messages 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 04 writes a multiple messages with colors: output as chunks 1`] = ` +Array [ + "[2] message 1message 2[n]", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 05 writes a messages with colors interspersed with non-colored messages: output 1`] = ` Object { "debug": "", "error": "message 1message 2message 3message 4[n]", @@ -840,7 +1376,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` +Array [ + "[2] message 1message 2message 3message 4[n]", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output 1`] = ` Object { "debug": "", "error": "message 1message 2message 3message 4[n]", @@ -850,7 +1392,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 07 writeVerbose 01 writes a single message 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` +Array [ + "[2] message 1message 2message 3message 4[n]", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 07 writeVerbose 01 writes a single message: output 1`] = ` Object { "debug": "", "error": "", @@ -860,7 +1408,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 07 writeVerbose 02 writes multiple messages 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 07 writeVerbose 01 writes a single message: output as chunks 1`] = ` +Array [ + "[3] test message", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 07 writeVerbose 02 writes multiple messages: output 1`] = ` Object { "debug": "", "error": "", @@ -870,7 +1424,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 07 writeVerbose 03 writes a message with colors 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 07 writeVerbose 02 writes multiple messages: output as chunks 1`] = ` +Array [ + "[3] message 1message 2", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 07 writeVerbose 03 writes a message with colors: output 1`] = ` Object { "debug": "", "error": "", @@ -880,7 +1440,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 07 writeVerbose 04 writes a multiple messages with colors 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 07 writeVerbose 03 writes a message with colors: output as chunks 1`] = ` +Array [ + "[3] message 1", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 07 writeVerbose 04 writes a multiple messages with colors: output 1`] = ` Object { "debug": "", "error": "", @@ -890,7 +1456,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 07 writeVerbose 05 writes a messages with colors interspersed with non-colored messages 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 07 writeVerbose 04 writes a multiple messages with colors: output as chunks 1`] = ` +Array [ + "[3] message 1message 2", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 07 writeVerbose 05 writes a messages with colors interspersed with non-colored messages: output 1`] = ` Object { "debug": "", "error": "", @@ -900,7 +1472,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 07 writeVerbose 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 07 writeVerbose 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` +Array [ + "[3] message 1message 2message 3message 4", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 07 writeVerbose 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output 1`] = ` Object { "debug": "", "error": "", @@ -910,7 +1488,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 01 writes a single message 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 07 writeVerbose 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` +Array [ + "[3] message 1message 2message 3message 4", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 01 writes a single message: output 1`] = ` Object { "debug": "", "error": "", @@ -920,7 +1504,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 02 writes multiple messages 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 01 writes a single message: output as chunks 1`] = ` +Array [ + "[3] test message[n]", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 02 writes multiple messages: output 1`] = ` Object { "debug": "", "error": "", @@ -930,7 +1520,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 03 writes a message with colors 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 02 writes multiple messages: output as chunks 1`] = ` +Array [ + "[3] message 1message 2[n]", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 03 writes a message with colors: output 1`] = ` Object { "debug": "", "error": "", @@ -940,7 +1536,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 04 writes a multiple messages with colors 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 03 writes a message with colors: output as chunks 1`] = ` +Array [ + "[3] message 1[n]", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 04 writes a multiple messages with colors: output 1`] = ` Object { "debug": "", "error": "", @@ -950,7 +1552,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 05 writes a messages with colors interspersed with non-colored messages 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 04 writes a multiple messages with colors: output as chunks 1`] = ` +Array [ + "[3] message 1message 2[n]", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 05 writes a messages with colors interspersed with non-colored messages: output 1`] = ` Object { "debug": "", "error": "", @@ -960,7 +1568,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` +Array [ + "[3] message 1message 2message 3message 4[n]", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output 1`] = ` Object { "debug": "", "error": "", @@ -970,7 +1584,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 09 writeDebug 01 writes a single message 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` +Array [ + "[3] message 1message 2message 3message 4[n]", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 09 writeDebug 01 writes a single message: output 1`] = ` Object { "debug": "test message", "error": "", @@ -980,7 +1600,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 09 writeDebug 02 writes multiple messages 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 09 writeDebug 01 writes a single message: output as chunks 1`] = ` +Array [ + "[4] test message", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 09 writeDebug 02 writes multiple messages: output 1`] = ` Object { "debug": "message 1message 2", "error": "", @@ -990,7 +1616,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 09 writeDebug 03 writes a message with colors 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 09 writeDebug 02 writes multiple messages: output as chunks 1`] = ` +Array [ + "[4] message 1message 2", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 09 writeDebug 03 writes a message with colors: output 1`] = ` Object { "debug": "message 1", "error": "", @@ -1000,7 +1632,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 09 writeDebug 04 writes a multiple messages with colors 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 09 writeDebug 03 writes a message with colors: output as chunks 1`] = ` +Array [ + "[4] message 1", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 09 writeDebug 04 writes a multiple messages with colors: output 1`] = ` Object { "debug": "message 1message 2", "error": "", @@ -1010,7 +1648,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 09 writeDebug 05 writes a messages with colors interspersed with non-colored messages 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 09 writeDebug 04 writes a multiple messages with colors: output as chunks 1`] = ` +Array [ + "[4] message 1message 2", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 09 writeDebug 05 writes a messages with colors interspersed with non-colored messages: output 1`] = ` Object { "debug": "message 1message 2message 3message 4", "error": "", @@ -1020,7 +1664,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 09 writeDebug 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 09 writeDebug 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` +Array [ + "[4] message 1message 2message 3message 4", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 09 writeDebug 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output 1`] = ` Object { "debug": "message 1message 2message 3message 4", "error": "", @@ -1030,7 +1680,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 01 writes a single message 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 09 writeDebug 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` +Array [ + "[4] message 1message 2message 3message 4", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 01 writes a single message: output 1`] = ` Object { "debug": "test message[n]", "error": "", @@ -1040,7 +1696,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 02 writes multiple messages 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 01 writes a single message: output as chunks 1`] = ` +Array [ + "[4] test message[n]", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 02 writes multiple messages: output 1`] = ` Object { "debug": "message 1message 2[n]", "error": "", @@ -1050,7 +1712,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 03 writes a message with colors 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 02 writes multiple messages: output as chunks 1`] = ` +Array [ + "[4] message 1message 2[n]", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 03 writes a message with colors: output 1`] = ` Object { "debug": "message 1[n]", "error": "", @@ -1060,7 +1728,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 04 writes a multiple messages with colors 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 03 writes a message with colors: output as chunks 1`] = ` +Array [ + "[4] message 1[n]", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 04 writes a multiple messages with colors: output 1`] = ` Object { "debug": "message 1message 2[n]", "error": "", @@ -1070,7 +1744,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 05 writes a messages with colors interspersed with non-colored messages 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 04 writes a multiple messages with colors: output as chunks 1`] = ` +Array [ + "[4] message 1message 2[n]", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 05 writes a messages with colors interspersed with non-colored messages: output 1`] = ` Object { "debug": "message 1message 2message 3message 4[n]", "error": "", @@ -1080,7 +1760,13 @@ Object { } `; -exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` +Array [ + "[4] message 1message 2message 3message 4[n]", +] +`; + +exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output 1`] = ` Object { "debug": "message 1message 2message 3message 4[n]", "error": "", @@ -1090,7 +1776,13 @@ Object { } `; -exports[`Terminal 02 color disabled 05 writes to multiple streams 1`] = ` +exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` +Array [ + "[4] message 1message 2message 3message 4[n]", +] +`; + +exports[`Terminal 02 color disabled 05 writes to multiple streams: output 1`] = ` Object { "debug": "", "error": "message 1message 2message 3message 4test message[n]message 1message 2message 1message 2[n]message 1message 1message 2message 3message 4[n]message 1[n]test messagemessage 1message 2[n]message 1message 2", @@ -1099,3 +1791,47 @@ Object { "warning": "message 1message 2[n]message 1message 2message 1message 2message 3message 4message 1message 2message 3message 4[n]test message[n]message 1message 2message 1message 1message 2[n]message 1[n]", } `; + +exports[`Terminal 02 color disabled 05 writes to multiple streams: output as chunks 1`] = ` +Array [ + "[0] message 1message 2message 3message 4", + "[1] message 1message 2[n]", + "[3] test message", + "[3] message 1", + "[0] message 1[n]", + "[2] message 1message 2message 3message 4", + "[2] test message[n]", + "[3] message 1message 2message 3message 4[n]", + "[3] test message[n]", + "[1] message 1message 2", + "[1] message 1message 2message 3message 4", + "[2] message 1message 2", + "[0] message 1", + "[3] message 1message 2message 3message 4", + "[2] message 1message 2[n]", + "[0] message 1message 2", + "[3] message 1message 2", + "[3] message 1[n]", + "[0] message 1message 2[n]", + "[2] message 1", + "[1] message 1message 2message 3message 4[n]", + "[0] test message", + "[1] test message[n]", + "[3] message 1message 2[n]", + "[3] message 1message 2[n]", + "[2] message 1message 2message 3message 4[n]", + "[0] message 1message 2message 3message 4[n]", + "[1] message 1message 2", + "[2] message 1[n]", + "[0] message 1message 2", + "[3] message 1message 2", + "[1] message 1", + "[0] test message[n]", + "[2] test message", + "[0] message 1message 2[n]", + "[2] message 1message 2[n]", + "[2] message 1message 2", + "[1] message 1message 2[n]", + "[1] message 1[n]", +] +`; diff --git a/libraries/terminal/src/test/__snapshots__/TerminalStreamWritable.test.ts.snap b/libraries/terminal/src/test/__snapshots__/TerminalStreamWritable.test.ts.snap index 7682242fb6..fd24916c81 100644 --- a/libraries/terminal/src/test/__snapshots__/TerminalStreamWritable.test.ts.snap +++ b/libraries/terminal/src/test/__snapshots__/TerminalStreamWritable.test.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`TerminalStreamWritable writes a debug message 1`] = ` +exports[`TerminalStreamWritable writes a debug message: output 1`] = ` Object { "debug": "test message", "error": "", @@ -10,7 +10,16 @@ Object { } `; -exports[`TerminalStreamWritable writes a message 1`] = ` +exports[`TerminalStreamWritable writes a debug message: output as chunks 1`] = ` +Array [ + Object { + "severity": "debug", + "text": "test message", + }, +] +`; + +exports[`TerminalStreamWritable writes a message: output 1`] = ` Object { "debug": "", "error": "", @@ -20,7 +29,16 @@ Object { } `; -exports[`TerminalStreamWritable writes a verbose message 1`] = ` +exports[`TerminalStreamWritable writes a message: output as chunks 1`] = ` +Array [ + Object { + "severity": "log", + "text": "test message", + }, +] +`; + +exports[`TerminalStreamWritable writes a verbose message: output 1`] = ` Object { "debug": "", "error": "", @@ -30,7 +48,16 @@ Object { } `; -exports[`TerminalStreamWritable writes a warning message 1`] = ` +exports[`TerminalStreamWritable writes a verbose message: output as chunks 1`] = ` +Array [ + Object { + "severity": "verbose", + "text": "test message", + }, +] +`; + +exports[`TerminalStreamWritable writes a warning message: output 1`] = ` Object { "debug": "", "error": "", @@ -40,7 +67,16 @@ Object { } `; -exports[`TerminalStreamWritable writes an error message 1`] = ` +exports[`TerminalStreamWritable writes a warning message: output as chunks 1`] = ` +Array [ + Object { + "severity": "warning", + "text": "[yellow]test message[default]", + }, +] +`; + +exports[`TerminalStreamWritable writes an error message: output 1`] = ` Object { "debug": "", "error": "[red]test message[default]", @@ -49,3 +85,12 @@ Object { "warning": "", } `; + +exports[`TerminalStreamWritable writes an error message: output as chunks 1`] = ` +Array [ + Object { + "severity": "error", + "text": "[red]test message[default]", + }, +] +`; diff --git a/rush-plugins/rush-http-build-cache-plugin/src/test/HttpBuildCacheProvider.test.ts b/rush-plugins/rush-http-build-cache-plugin/src/test/HttpBuildCacheProvider.test.ts index 053ee007dd..bf9be3d1ef 100644 --- a/rush-plugins/rush-http-build-cache-plugin/src/test/HttpBuildCacheProvider.test.ts +++ b/rush-plugins/rush-http-build-cache-plugin/src/test/HttpBuildCacheProvider.test.ts @@ -66,11 +66,18 @@ describe('HttpBuildCacheProvider', () => { redirect: 'follow' }) ); - expect(terminalBuffer.getAllOutput(true)).toMatchInlineSnapshot(` -Object { - "debug": "[http-build-cache] request: GET https://buildcache.example.acme.com/some-key unknown bytes[n]", - "warning": "Error getting cache entry: Error: Credentials for https://buildcache.example.acme.com/ have not been provided.[n]In CI, verify that RUSH_BUILD_CACHE_CREDENTIAL contains a valid Authorization header value.[n][n]For local developers, run:[n][n] rush update-cloud-credentials --interactive[n][n]", -} + expect(terminalBuffer.getAllOutputAsChunks({ asFlat: true, severityAsNames: true })) + .toMatchInlineSnapshot(` +Array [ + Object { + "severity": 4, + "text": "[http-build-cache] request: GET https://buildcache.example.acme.com/some-key unknown bytes[n]", + }, + Object { + "severity": 1, + "text": "Error getting cache entry: Error: Credentials for https://buildcache.example.acme.com/ have not been provided.[n]In CI, verify that RUSH_BUILD_CACHE_CREDENTIAL contains a valid Authorization header value.[n][n]For local developers, run:[n][n] rush update-cloud-credentials --interactive[n][n]", + }, +] `); }); @@ -123,11 +130,26 @@ Object { redirect: 'follow' }) ); - expect(terminalBuffer.getAllOutput(true)).toMatchInlineSnapshot(` -Object { - "debug": "[http-build-cache] request: GET https://buildcache.example.acme.com/some-key unknown bytes[n][http-build-cache] request: GET https://buildcache.example.acme.com/some-key unknown bytes[n][http-build-cache] request: GET https://buildcache.example.acme.com/some-key unknown bytes[n]", - "warning": "Could not get cache entry: HTTP 504: BadGateway[n]", -} + expect(terminalBuffer.getAllOutputAsChunks({ asFlat: true, severityAsNames: true })) + .toMatchInlineSnapshot(` +Array [ + Object { + "severity": 4, + "text": "[http-build-cache] request: GET https://buildcache.example.acme.com/some-key unknown bytes[n]", + }, + Object { + "severity": 4, + "text": "[http-build-cache] request: GET https://buildcache.example.acme.com/some-key unknown bytes[n]", + }, + Object { + "severity": 4, + "text": "[http-build-cache] request: GET https://buildcache.example.acme.com/some-key unknown bytes[n]", + }, + Object { + "severity": 1, + "text": "Could not get cache entry: HTTP 504: BadGateway[n]", + }, +] `); }); }); From 155781feaa6816a60f8944b5c27e13a11dcd8f71 Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Sat, 3 Jan 2026 19:07:29 -0800 Subject: [PATCH 04/14] fixup! Update tests to use StringBufferTerminalProvider.getAllOutputAsChunks. --- .../test/OperationMetadataManager.test.ts | 2 +- .../src/test/HttpBuildCacheProvider.test.ts | 30 ++++--------------- 2 files changed, 7 insertions(+), 25 deletions(-) diff --git a/libraries/rush-lib/src/logic/operations/test/OperationMetadataManager.test.ts b/libraries/rush-lib/src/logic/operations/test/OperationMetadataManager.test.ts index 2c3c97db06..186d80d6d9 100644 --- a/libraries/rush-lib/src/logic/operations/test/OperationMetadataManager.test.ts +++ b/libraries/rush-lib/src/logic/operations/test/OperationMetadataManager.test.ts @@ -136,7 +136,7 @@ describe(OperationMetadataManager.name, () => { errorLogPath: '/path/to/errorLog' }); - expect(mockTerminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true })).toEqual({}); + expect(mockTerminalProvider.getAllOutput()).toEqual({}); expect(mockClose).toHaveBeenCalledTimes(1); expect(mockWritable.chunks).toMatchSnapshot(); }); diff --git a/rush-plugins/rush-http-build-cache-plugin/src/test/HttpBuildCacheProvider.test.ts b/rush-plugins/rush-http-build-cache-plugin/src/test/HttpBuildCacheProvider.test.ts index bf9be3d1ef..0e5258eca9 100644 --- a/rush-plugins/rush-http-build-cache-plugin/src/test/HttpBuildCacheProvider.test.ts +++ b/rush-plugins/rush-http-build-cache-plugin/src/test/HttpBuildCacheProvider.test.ts @@ -69,14 +69,8 @@ describe('HttpBuildCacheProvider', () => { expect(terminalBuffer.getAllOutputAsChunks({ asFlat: true, severityAsNames: true })) .toMatchInlineSnapshot(` Array [ - Object { - "severity": 4, - "text": "[http-build-cache] request: GET https://buildcache.example.acme.com/some-key unknown bytes[n]", - }, - Object { - "severity": 1, - "text": "Error getting cache entry: Error: Credentials for https://buildcache.example.acme.com/ have not been provided.[n]In CI, verify that RUSH_BUILD_CACHE_CREDENTIAL contains a valid Authorization header value.[n][n]For local developers, run:[n][n] rush update-cloud-credentials --interactive[n][n]", - }, + "[ debug] [http-build-cache] request: GET https://buildcache.example.acme.com/some-key unknown bytes[n]", + "[warning] Error getting cache entry: Error: Credentials for https://buildcache.example.acme.com/ have not been provided.[n]In CI, verify that RUSH_BUILD_CACHE_CREDENTIAL contains a valid Authorization header value.[n][n]For local developers, run:[n][n] rush update-cloud-credentials --interactive[n][n]", ] `); }); @@ -133,22 +127,10 @@ Array [ expect(terminalBuffer.getAllOutputAsChunks({ asFlat: true, severityAsNames: true })) .toMatchInlineSnapshot(` Array [ - Object { - "severity": 4, - "text": "[http-build-cache] request: GET https://buildcache.example.acme.com/some-key unknown bytes[n]", - }, - Object { - "severity": 4, - "text": "[http-build-cache] request: GET https://buildcache.example.acme.com/some-key unknown bytes[n]", - }, - Object { - "severity": 4, - "text": "[http-build-cache] request: GET https://buildcache.example.acme.com/some-key unknown bytes[n]", - }, - Object { - "severity": 1, - "text": "Could not get cache entry: HTTP 504: BadGateway[n]", - }, + "[ debug] [http-build-cache] request: GET https://buildcache.example.acme.com/some-key unknown bytes[n]", + "[ debug] [http-build-cache] request: GET https://buildcache.example.acme.com/some-key unknown bytes[n]", + "[ debug] [http-build-cache] request: GET https://buildcache.example.acme.com/some-key unknown bytes[n]", + "[warning] Could not get cache entry: HTTP 504: BadGateway[n]", ] `); }); From be3dc597ce373b2786caaac607823872d29a695e Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Sat, 3 Jan 2026 19:27:19 -0800 Subject: [PATCH 05/14] fixup! Update tests to use StringBufferTerminalProvider.getAllOutputAsChunks. --- .../src/logic/operations/test/OperationMetadataManager.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/rush-lib/src/logic/operations/test/OperationMetadataManager.test.ts b/libraries/rush-lib/src/logic/operations/test/OperationMetadataManager.test.ts index 186d80d6d9..a25fe0edbe 100644 --- a/libraries/rush-lib/src/logic/operations/test/OperationMetadataManager.test.ts +++ b/libraries/rush-lib/src/logic/operations/test/OperationMetadataManager.test.ts @@ -136,7 +136,7 @@ describe(OperationMetadataManager.name, () => { errorLogPath: '/path/to/errorLog' }); - expect(mockTerminalProvider.getAllOutput()).toEqual({}); + expect(mockTerminalProvider.getAllOutput(true)).toEqual({}); expect(mockClose).toHaveBeenCalledTimes(1); expect(mockWritable.chunks).toMatchSnapshot(); }); From ca9e8141e75d637b6b96c8582f70ac96f3f55132 Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Sat, 3 Jan 2026 19:27:50 -0800 Subject: [PATCH 06/14] Remove the severityAsNames option. --- common/reviews/api/terminal.api.md | 19 +----- .../src/StringBufferTerminalProvider.ts | 62 +++++-------------- 2 files changed, 20 insertions(+), 61 deletions(-) diff --git a/common/reviews/api/terminal.api.md b/common/reviews/api/terminal.api.md index 7de496f099..72443eb5f5 100644 --- a/common/reviews/api/terminal.api.md +++ b/common/reviews/api/terminal.api.md @@ -152,9 +152,9 @@ export interface INormalizeNewlinesTextRewriterOptions { } // @beta (undocumented) -export interface IOutputChunk { +export interface IOutputChunk { // (undocumented) - severity: TSeverity; + severity: TerminalProviderSeverityName; // (undocumented) text: string; } @@ -203,7 +203,6 @@ export interface IStdioSummarizerOptions extends ITerminalWritableOptions { // @beta (undocumented) export interface IStringBufferOutputChunksOptions extends IStringBufferOutputOptions { asFlat?: boolean; - severityAsNames?: boolean; } // @beta (undocumented) @@ -396,22 +395,10 @@ export class StringBufferTerminalProvider implements ITerminalProvider { // (undocumented) getAllOutput(sparse: true, options?: IStringBufferOutputOptions): Partial; getAllOutputAsChunks(options?: IStringBufferOutputChunksOptions & { - severityAsNames?: false; asFlat?: false; - }): IOutputChunk[]; + }): IOutputChunk[]; // (undocumented) getAllOutputAsChunks(options: IStringBufferOutputChunksOptions & { - severityAsNames: true; - asFlat?: false; - }): IOutputChunk[]; - // (undocumented) - getAllOutputAsChunks(options?: IStringBufferOutputChunksOptions & { - severityAsNames?: false; - asFlat: true; - }): `[${TerminalProviderSeverity}] ${string}`[]; - // (undocumented) - getAllOutputAsChunks(options: IStringBufferOutputChunksOptions & { - severityAsNames: true; asFlat: true; }): `[${string}] ${string}`[]; getDebugOutput(options?: IStringBufferOutputOptions): string; diff --git a/libraries/terminal/src/StringBufferTerminalProvider.ts b/libraries/terminal/src/StringBufferTerminalProvider.ts index 07af24365c..df3077ab71 100644 --- a/libraries/terminal/src/StringBufferTerminalProvider.ts +++ b/libraries/terminal/src/StringBufferTerminalProvider.ts @@ -23,11 +23,6 @@ export interface IStringBufferOutputOptions { * @beta */ export interface IStringBufferOutputChunksOptions extends IStringBufferOutputOptions { - /** - * If true, the severity levels will be represented as names instead of as enum values. - */ - severityAsNames?: boolean; - /** * If true, the output chunks will be returned as a flat array of prefixed strings of an array of objects. */ @@ -53,9 +48,9 @@ export type TerminalProviderSeverityName = keyof typeof TerminalProviderSeverity /** * @beta */ -export interface IOutputChunk { +export interface IOutputChunk { text: string; - severity: TSeverity; + severity: TerminalProviderSeverityName; } function _normalizeOutput(s: string, options: IStringBufferOutputOptions | undefined): string { @@ -91,7 +86,7 @@ export class StringBufferTerminalProvider implements ITerminalProvider { private _debugBuffer: StringBuilder = new StringBuilder(); private _warningBuffer: StringBuilder = new StringBuilder(); private _errorBuffer: StringBuilder = new StringBuilder(); - private _allOutputChunks: IOutputChunk[] = []; + private _allOutputChunks: IOutputChunk[] = []; /** * {@inheritDoc ITerminalProvider.supportsColor} @@ -106,7 +101,10 @@ export class StringBufferTerminalProvider implements ITerminalProvider { * {@inheritDoc ITerminalProvider.write} */ public write(text: string, severity: TerminalProviderSeverity): void { - this._allOutputChunks.push({ text, severity }); + this._allOutputChunks.push({ + text, + severity: TerminalProviderSeverity[severity] as TerminalProviderSeverityName + }); switch (severity) { case TerminalProviderSeverity.warning: { @@ -229,50 +227,24 @@ export class StringBufferTerminalProvider implements ITerminalProvider { * Get everything that has been written as an array of output chunks, preserving order. */ public getAllOutputAsChunks( - options?: IStringBufferOutputChunksOptions & { severityAsNames?: false; asFlat?: false } - ): IOutputChunk[]; + options?: IStringBufferOutputChunksOptions & { asFlat?: false } + ): IOutputChunk[]; public getAllOutputAsChunks( - options: IStringBufferOutputChunksOptions & { severityAsNames: true; asFlat?: false } - ): IOutputChunk[]; - public getAllOutputAsChunks( - options?: IStringBufferOutputChunksOptions & { severityAsNames?: false; asFlat: true } - ): `[${TerminalProviderSeverity}] ${string}`[]; - public getAllOutputAsChunks( - options: IStringBufferOutputChunksOptions & { severityAsNames: true; asFlat: true } + options: IStringBufferOutputChunksOptions & { asFlat: true } ): `[${string}] ${string}`[]; - public getAllOutputAsChunks( - options: IStringBufferOutputChunksOptions = {} - ): IOutputChunk[] | string[] { - const { asFlat, severityAsNames } = options; - - function getNormalizedSeverity( - rawSeverity: TerminalProviderSeverity - ): TerminalProviderSeverity | TerminalProviderSeverityName { - if (severityAsNames) { - return TerminalProviderSeverity[rawSeverity] as TerminalProviderSeverityName; - } else { - return rawSeverity; - } - } - - if (asFlat) { + public getAllOutputAsChunks(options: IStringBufferOutputChunksOptions = {}): IOutputChunk[] | string[] { + if (options.asFlat) { return this._allOutputChunks.map(({ text: rawText, severity: rawSeverity }) => { - const severity: TerminalProviderSeverity | `${string}${TerminalProviderSeverityName}` = - getNormalizedSeverity(rawSeverity); const text: string = _normalizeOutput(rawText, options); + const severity: TerminalProviderSeverity | string = ( + rawSeverity as TerminalProviderSeverityName + ).padStart(LONGEST_SEVERITY_NAME_LENGTH, ' '); - const paddedSeverity: TerminalProviderSeverity | string = severityAsNames - ? (severity as TerminalProviderSeverityName).padStart(LONGEST_SEVERITY_NAME_LENGTH, ' ') - : severity; - - return `[${paddedSeverity}] ${text}`; + return `[${severity}] ${text}`; }); } else { - return this._allOutputChunks.map(({ text: rawText, severity: rawSeverity }) => { - const severity: TerminalProviderSeverity | TerminalProviderSeverityName = - getNormalizedSeverity(rawSeverity); + return this._allOutputChunks.map(({ text: rawText, severity }) => { const text: string = _normalizeOutput(rawText, options); - return { text, severity From 3dce7afa173b089587026e6ac06010b25da8b8a6 Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Sat, 3 Jan 2026 19:28:08 -0800 Subject: [PATCH 07/14] fixup! Update tests to use StringBufferTerminalProvider.getAllOutputAsChunks. --- .../src/test/ConfigurationFile.test.ts | 2 +- .../src/parsers/test/parseResx.test.ts | 4 +- .../test/OperationExecutionManager.test.ts | 36 +- .../api/test/CustomTipsConfiguration.test.ts | 5 +- .../api/test/RushProjectConfiguration.test.ts | 8 +- .../operations/test/BuildPlanPlugin.test.ts | 3 +- .../test/OperationMetadataManager.test.ts | 12 +- .../pnpm/test/PnpmShrinkwrapFile.test.ts | 4 +- .../src/logic/test/InstallHelpers.test.ts | 3 +- .../test/ProjectImpactGraphGenerator.test.ts | 3 +- .../test/PrefixProxyTerminalProvider.test.ts | 4 +- .../src/test/TerminalStreamWritable.test.ts | 2 +- .../test/__snapshots__/Terminal.test.ts.snap | 372 +++++++++--------- .../src/test/HttpBuildCacheProvider.test.ts | 6 +- 14 files changed, 211 insertions(+), 253 deletions(-) diff --git a/libraries/heft-config-file/src/test/ConfigurationFile.test.ts b/libraries/heft-config-file/src/test/ConfigurationFile.test.ts index 121bfb36a7..aead730280 100644 --- a/libraries/heft-config-file/src/test/ConfigurationFile.test.ts +++ b/libraries/heft-config-file/src/test/ConfigurationFile.test.ts @@ -26,7 +26,7 @@ describe('ConfigurationFile', () => { }); afterEach(() => { - expect(terminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true })).toMatchSnapshot(); + expect(terminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot(); }); describe('A simple config file', () => { diff --git a/libraries/localization-utilities/src/parsers/test/parseResx.test.ts b/libraries/localization-utilities/src/parsers/test/parseResx.test.ts index 360fcda776..a1ac48fdd4 100644 --- a/libraries/localization-utilities/src/parsers/test/parseResx.test.ts +++ b/libraries/localization-utilities/src/parsers/test/parseResx.test.ts @@ -16,9 +16,7 @@ describe(parseResx.name, () => { }); afterEach(() => { - expect(terminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true })).toMatchSnapshot( - 'terminal output' - ); + expect(terminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot('terminal output'); }); async function testResxAsync( diff --git a/libraries/operation-graph/src/test/OperationExecutionManager.test.ts b/libraries/operation-graph/src/test/OperationExecutionManager.test.ts index c39456bcdc..137d814410 100644 --- a/libraries/operation-graph/src/test/OperationExecutionManager.test.ts +++ b/libraries/operation-graph/src/test/OperationExecutionManager.test.ts @@ -68,9 +68,7 @@ describe(OperationExecutionManager.name, () => { }); expect(result).toBe(OperationStatus.NoOp); - expect( - terminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true }) - ).toMatchSnapshot(); + expect(terminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot(); }); it('handles trivial input', async () => { @@ -89,9 +87,7 @@ describe(OperationExecutionManager.name, () => { }); expect(result).toBe(OperationStatus.Success); - expect( - terminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true }) - ).toMatchSnapshot(); + expect(terminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot(); expect(operation.state?.status).toBe(OperationStatus.NoOp); }); @@ -139,9 +135,7 @@ describe(OperationExecutionManager.name, () => { }); expect(result).toBe(OperationStatus.Success); - expect( - terminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true }) - ).toMatchSnapshot(); + expect(terminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot(); expect(runAlpha).toHaveBeenCalledTimes(1); expect(runBeta).toHaveBeenCalledTimes(1); @@ -193,9 +187,7 @@ describe(OperationExecutionManager.name, () => { }); expect(result).toBe(OperationStatus.Failure); - expect( - terminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true }) - ).toMatchSnapshot(); + expect(terminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot(); expect(runAlpha).toHaveBeenCalledTimes(1); expect(runBeta).toHaveBeenCalledTimes(0); @@ -226,9 +218,7 @@ describe(OperationExecutionManager.name, () => { }); expect(result).toBe(OperationStatus.NoOp); - expect( - terminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true }) - ).toMatchSnapshot(); + expect(terminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot(); }); it('respects priority order', async () => { @@ -281,9 +271,7 @@ describe(OperationExecutionManager.name, () => { expect(executed).toEqual([beta, alpha]); expect(result).toBe(OperationStatus.Success); - expect( - terminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true }) - ).toMatchSnapshot(); + expect(terminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot(); expect(runAlpha).toHaveBeenCalledTimes(1); expect(runBeta).toHaveBeenCalledTimes(1); @@ -336,9 +324,7 @@ describe(OperationExecutionManager.name, () => { }); expect(result).toBe(OperationStatus.Success); - expect( - terminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true }) - ).toMatchSnapshot(); + expect(terminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot(); expect(run).toHaveBeenCalledTimes(2); @@ -405,9 +391,7 @@ describe(OperationExecutionManager.name, () => { expect(betaRequestRun).toBeDefined(); expect(result1).toBe(OperationStatus.Success); - expect( - terminalProvider1.getAllOutputAsChunks({ asFlat: true, severityAsNames: true }) - ).toMatchSnapshot('first'); + expect(terminalProvider1.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot('first'); expect(runAlpha).toHaveBeenCalledTimes(1); expect(runBeta).toHaveBeenCalledTimes(1); @@ -439,9 +423,7 @@ describe(OperationExecutionManager.name, () => { }); expect(result2).toBe(OperationStatus.Success); - expect( - terminalProvider2.getAllOutputAsChunks({ asFlat: true, severityAsNames: true }) - ).toMatchSnapshot('second'); + expect(terminalProvider2.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot('second'); expect(runAlpha).toHaveBeenCalledTimes(2); expect(runBeta).toHaveBeenCalledTimes(2); diff --git a/libraries/rush-lib/src/api/test/CustomTipsConfiguration.test.ts b/libraries/rush-lib/src/api/test/CustomTipsConfiguration.test.ts index 5883f32e2c..469cd8ea32 100644 --- a/libraries/rush-lib/src/api/test/CustomTipsConfiguration.test.ts +++ b/libraries/rush-lib/src/api/test/CustomTipsConfiguration.test.ts @@ -58,10 +58,7 @@ describe(CustomTipsConfiguration.name, () => { afterEach(() => { jest.restoreAllMocks(); - const terminalProviderOutput: IOutputChunk[] = - terminalProvider.getAllOutputAsChunks({ - severityAsNames: true - }); + const terminalProviderOutput: IOutputChunk[] = terminalProvider.getAllOutputAsChunks(); const lineSplitTerminalProviderOutput: string[] = []; for (const { text, severity } of terminalProviderOutput) { const lines: string[] = text.split('[n]'); diff --git a/libraries/rush-lib/src/api/test/RushProjectConfiguration.test.ts b/libraries/rush-lib/src/api/test/RushProjectConfiguration.test.ts index d237050ccc..7a509dee81 100644 --- a/libraries/rush-lib/src/api/test/RushProjectConfiguration.test.ts +++ b/libraries/rush-lib/src/api/test/RushProjectConfiguration.test.ts @@ -63,9 +63,7 @@ function validateConfiguration(rushProjectConfiguration: RushProjectConfiguratio terminal ); } finally { - expect( - terminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true }) - ).toMatchSnapshot(); + expect(terminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot(); } } } @@ -92,9 +90,7 @@ function validateConfigurationWithParameters( terminal ); } finally { - expect( - terminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true }) - ).toMatchSnapshot(); + expect(terminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot(); } } } diff --git a/libraries/rush-lib/src/logic/operations/test/BuildPlanPlugin.test.ts b/libraries/rush-lib/src/logic/operations/test/BuildPlanPlugin.test.ts index 9a7b6d56e1..0af8c9c772 100644 --- a/libraries/rush-lib/src/logic/operations/test/BuildPlanPlugin.test.ts +++ b/libraries/rush-lib/src/logic/operations/test/BuildPlanPlugin.test.ts @@ -141,8 +141,7 @@ describe(BuildPlanPlugin.name, () => { expect( stringBufferTerminalProvider.getAllOutputAsChunks({ normalizeSpecialCharacters: false, - asFlat: true, - severityAsNames: true + asFlat: true }) ).toMatchSnapshot(); }); diff --git a/libraries/rush-lib/src/logic/operations/test/OperationMetadataManager.test.ts b/libraries/rush-lib/src/logic/operations/test/OperationMetadataManager.test.ts index a25fe0edbe..a6ac995171 100644 --- a/libraries/rush-lib/src/logic/operations/test/OperationMetadataManager.test.ts +++ b/libraries/rush-lib/src/logic/operations/test/OperationMetadataManager.test.ts @@ -63,9 +63,7 @@ describe(OperationMetadataManager.name, () => { errorLogPath: '/path/to/errorLog' }); - expect( - mockTerminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true }) - ).toMatchSnapshot(); + expect(mockTerminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot(); expect(mockTerminalProvider.getWarningOutput()).toBeFalsy(); }); @@ -89,9 +87,7 @@ describe(OperationMetadataManager.name, () => { errorLogPath: '/path/to/errorLog' }); - expect( - mockTerminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true }) - ).toMatchSnapshot(); + expect(mockTerminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot(); }); it('should restore mixed chunked output', async () => { @@ -113,9 +109,7 @@ describe(OperationMetadataManager.name, () => { terminalProvider: mockTerminalProvider, errorLogPath: '/path/to/errorLog' }); - expect( - mockTerminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true }) - ).toMatchSnapshot(); + expect(mockTerminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot(); }); it("should fallback to the log file when chunked output isn't available", async () => { diff --git a/libraries/rush-lib/src/logic/pnpm/test/PnpmShrinkwrapFile.test.ts b/libraries/rush-lib/src/logic/pnpm/test/PnpmShrinkwrapFile.test.ts index 3a8926cd94..82b5a6012d 100644 --- a/libraries/rush-lib/src/logic/pnpm/test/PnpmShrinkwrapFile.test.ts +++ b/libraries/rush-lib/src/logic/pnpm/test/PnpmShrinkwrapFile.test.ts @@ -546,9 +546,7 @@ snapshots: terminal ) ).toThrowError(AlreadyReportedError); - expect( - terminalProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true }) - ).toMatchSnapshot(); + expect(terminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot(); }); }); }); diff --git a/libraries/rush-lib/src/logic/test/InstallHelpers.test.ts b/libraries/rush-lib/src/logic/test/InstallHelpers.test.ts index 8d8575cb6d..d427a9aec9 100644 --- a/libraries/rush-lib/src/logic/test/InstallHelpers.test.ts +++ b/libraries/rush-lib/src/logic/test/InstallHelpers.test.ts @@ -28,8 +28,7 @@ describe('InstallHelpers', () => { expect( terminalProvider.getAllOutputAsChunks({ normalizeSpecialCharacters: true, - asFlat: true, - severityAsNames: true + asFlat: true }) ).toMatchSnapshot('Terminal Output'); mockJsonFileSave.mockClear(); diff --git a/libraries/rush-lib/src/logic/test/ProjectImpactGraphGenerator.test.ts b/libraries/rush-lib/src/logic/test/ProjectImpactGraphGenerator.test.ts index e269a581ac..5261fe3096 100644 --- a/libraries/rush-lib/src/logic/test/ProjectImpactGraphGenerator.test.ts +++ b/libraries/rush-lib/src/logic/test/ProjectImpactGraphGenerator.test.ts @@ -25,8 +25,7 @@ async function runTestForExampleRepoAsync( expect( terminalProvider.getAllOutputAsChunks({ normalizeSpecialCharacters: true, - asFlat: true, - severityAsNames: true + asFlat: true }) ).toMatchSnapshot('Terminal Output'); } diff --git a/libraries/terminal/src/test/PrefixProxyTerminalProvider.test.ts b/libraries/terminal/src/test/PrefixProxyTerminalProvider.test.ts index bc8c88b27c..12e2384d3c 100644 --- a/libraries/terminal/src/test/PrefixProxyTerminalProvider.test.ts +++ b/libraries/terminal/src/test/PrefixProxyTerminalProvider.test.ts @@ -14,9 +14,7 @@ function runTestsForTerminalProvider( function verifyProvider(): void { expect(baseProvider.getAllOutput(true)).toMatchSnapshot('output'); - expect(baseProvider.getAllOutputAsChunks({ asFlat: true, severityAsNames: true })).toMatchSnapshot( - 'output as chunks' - ); + expect(baseProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot('output as chunks'); } beforeEach(() => { diff --git a/libraries/terminal/src/test/TerminalStreamWritable.test.ts b/libraries/terminal/src/test/TerminalStreamWritable.test.ts index 6e01e82038..e6b639dd95 100644 --- a/libraries/terminal/src/test/TerminalStreamWritable.test.ts +++ b/libraries/terminal/src/test/TerminalStreamWritable.test.ts @@ -12,7 +12,7 @@ let provider: StringBufferTerminalProvider; function verifyProvider(): void { expect(provider.getAllOutput()).toMatchSnapshot('output'); - expect(provider.getAllOutputAsChunks({ severityAsNames: true })).toMatchSnapshot('output as chunks'); + expect(provider.getAllOutputAsChunks()).toMatchSnapshot('output as chunks'); } async function writeAsync(writable: Writable, data: string): Promise { diff --git a/libraries/terminal/src/test/__snapshots__/Terminal.test.ts.snap b/libraries/terminal/src/test/__snapshots__/Terminal.test.ts.snap index 92c62bdff5..46bd89aae1 100644 --- a/libraries/terminal/src/test/__snapshots__/Terminal.test.ts.snap +++ b/libraries/terminal/src/test/__snapshots__/Terminal.test.ts.snap @@ -12,7 +12,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 01 write 01 writes a single message: output as chunks 1`] = ` Array [ - "[0] test message", + "[ log] test message", ] `; @@ -28,7 +28,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 01 write 02 writes multiple messages: output as chunks 1`] = ` Array [ - "[0] message 1message 2", + "[ log] message 1message 2", ] `; @@ -44,7 +44,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 01 write 03 writes a message with colors: output as chunks 1`] = ` Array [ - "[0] [green]message 1[default]", + "[ log] [green]message 1[default]", ] `; @@ -60,7 +60,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 01 write 04 writes a multiple messages with colors: output as chunks 1`] = ` Array [ - "[0] [green]message 1[default][red]message 2[default]", + "[ log] [green]message 1[default][red]message 2[default]", ] `; @@ -76,7 +76,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 01 write 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` Array [ - "[0] message 1[green]message 2[default]message 3[red]message 4[default]", + "[ log] message 1[green]message 2[default]message 3[red]message 4[default]", ] `; @@ -92,7 +92,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 01 write 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` Array [ - "[0] message 1[green]message 2[default]message 3[red]message 4[default]", + "[ log] message 1[green]message 2[default]message 3[red]message 4[default]", ] `; @@ -108,7 +108,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 01 writes a single message: output as chunks 1`] = ` Array [ - "[0] test message[n]", + "[ log] test message[n]", ] `; @@ -124,7 +124,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 02 writes multiple messages: output as chunks 1`] = ` Array [ - "[0] message 1message 2[n]", + "[ log] message 1message 2[n]", ] `; @@ -140,7 +140,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 03 writes a message with colors: output as chunks 1`] = ` Array [ - "[0] [green]message 1[default][n]", + "[ log] [green]message 1[default][n]", ] `; @@ -156,7 +156,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 04 writes a multiple messages with colors: output as chunks 1`] = ` Array [ - "[0] [green]message 1[default][red]message 2[default][n]", + "[ log] [green]message 1[default][red]message 2[default][n]", ] `; @@ -172,7 +172,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` Array [ - "[0] message 1[green]message 2[default]message 3[red]message 4[default][n]", + "[ log] message 1[green]message 2[default]message 3[red]message 4[default][n]", ] `; @@ -188,7 +188,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` Array [ - "[0] message 1[green]message 2[default]message 3[red]message 4[default][n]", + "[ log] message 1[green]message 2[default]message 3[red]message 4[default][n]", ] `; @@ -204,7 +204,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 03 writeWarning 01 writes a single message: output as chunks 1`] = ` Array [ - "[1] [yellow]test message[default]", + "[warning] [yellow]test message[default]", ] `; @@ -220,7 +220,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 03 writeWarning 02 writes multiple messages: output as chunks 1`] = ` Array [ - "[1] [yellow]message 1[default][yellow]message 2[default]", + "[warning] [yellow]message 1[default][yellow]message 2[default]", ] `; @@ -236,7 +236,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 03 writeWarning 03 writes a message with colors: output as chunks 1`] = ` Array [ - "[1] [yellow]message 1[default]", + "[warning] [yellow]message 1[default]", ] `; @@ -252,7 +252,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 03 writeWarning 04 writes a multiple messages with colors: output as chunks 1`] = ` Array [ - "[1] [yellow]message 1[default][yellow]message 2[default]", + "[warning] [yellow]message 1[default][yellow]message 2[default]", ] `; @@ -268,7 +268,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 03 writeWarning 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` Array [ - "[1] [yellow]message 1[default][yellow]message 2[default][yellow]message 3[default][yellow]message 4[default]", + "[warning] [yellow]message 1[default][yellow]message 2[default][yellow]message 3[default][yellow]message 4[default]", ] `; @@ -284,7 +284,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 03 writeWarning 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` Array [ - "[1] message 1[green]message 2[default]message 3[red]message 4[default]", + "[warning] message 1[green]message 2[default]message 3[red]message 4[default]", ] `; @@ -300,7 +300,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 01 writes a single message: output as chunks 1`] = ` Array [ - "[1] [yellow]test message[default][n]", + "[warning] [yellow]test message[default][n]", ] `; @@ -316,7 +316,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 02 writes multiple messages: output as chunks 1`] = ` Array [ - "[1] [yellow]message 1[default][yellow]message 2[default][n]", + "[warning] [yellow]message 1[default][yellow]message 2[default][n]", ] `; @@ -332,7 +332,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 03 writes a message with colors: output as chunks 1`] = ` Array [ - "[1] [yellow]message 1[default][n]", + "[warning] [yellow]message 1[default][n]", ] `; @@ -348,7 +348,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 04 writes a multiple messages with colors: output as chunks 1`] = ` Array [ - "[1] [yellow]message 1[default][yellow]message 2[default][n]", + "[warning] [yellow]message 1[default][yellow]message 2[default][n]", ] `; @@ -364,7 +364,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` Array [ - "[1] [yellow]message 1[default][yellow]message 2[default][yellow]message 3[default][yellow]message 4[default][n]", + "[warning] [yellow]message 1[default][yellow]message 2[default][yellow]message 3[default][yellow]message 4[default][n]", ] `; @@ -380,7 +380,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` Array [ - "[1] message 1[green]message 2[default]message 3[red]message 4[default][n]", + "[warning] message 1[green]message 2[default]message 3[red]message 4[default][n]", ] `; @@ -396,7 +396,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 05 writeError 01 writes a single message: output as chunks 1`] = ` Array [ - "[2] [red]test message[default]", + "[ error] [red]test message[default]", ] `; @@ -412,7 +412,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 05 writeError 02 writes multiple messages: output as chunks 1`] = ` Array [ - "[2] [red]message 1[default][red]message 2[default]", + "[ error] [red]message 1[default][red]message 2[default]", ] `; @@ -428,7 +428,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 05 writeError 03 writes a message with colors: output as chunks 1`] = ` Array [ - "[2] [red]message 1[default]", + "[ error] [red]message 1[default]", ] `; @@ -444,7 +444,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 05 writeError 04 writes a multiple messages with colors: output as chunks 1`] = ` Array [ - "[2] [red]message 1[default][red]message 2[default]", + "[ error] [red]message 1[default][red]message 2[default]", ] `; @@ -460,7 +460,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 05 writeError 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` Array [ - "[2] [red]message 1[default][red]message 2[default][red]message 3[default][red]message 4[default]", + "[ error] [red]message 1[default][red]message 2[default][red]message 3[default][red]message 4[default]", ] `; @@ -476,7 +476,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 05 writeError 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` Array [ - "[2] message 1[green]message 2[default]message 3[red]message 4[default]", + "[ error] message 1[green]message 2[default]message 3[red]message 4[default]", ] `; @@ -492,7 +492,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 01 writes a single message: output as chunks 1`] = ` Array [ - "[2] [red]test message[default][n]", + "[ error] [red]test message[default][n]", ] `; @@ -508,7 +508,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 02 writes multiple messages: output as chunks 1`] = ` Array [ - "[2] [red]message 1[default][red]message 2[default][n]", + "[ error] [red]message 1[default][red]message 2[default][n]", ] `; @@ -524,7 +524,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 03 writes a message with colors: output as chunks 1`] = ` Array [ - "[2] [red]message 1[default][n]", + "[ error] [red]message 1[default][n]", ] `; @@ -540,7 +540,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 04 writes a multiple messages with colors: output as chunks 1`] = ` Array [ - "[2] [red]message 1[default][red]message 2[default][n]", + "[ error] [red]message 1[default][red]message 2[default][n]", ] `; @@ -556,7 +556,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` Array [ - "[2] [red]message 1[default][red]message 2[default][red]message 3[default][red]message 4[default][n]", + "[ error] [red]message 1[default][red]message 2[default][red]message 3[default][red]message 4[default][n]", ] `; @@ -572,7 +572,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` Array [ - "[2] message 1[green]message 2[default]message 3[red]message 4[default][n]", + "[ error] message 1[green]message 2[default]message 3[red]message 4[default][n]", ] `; @@ -588,7 +588,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 07 writeVerbose 01 writes a single message: output as chunks 1`] = ` Array [ - "[3] test message", + "[verbose] test message", ] `; @@ -604,7 +604,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 07 writeVerbose 02 writes multiple messages: output as chunks 1`] = ` Array [ - "[3] message 1message 2", + "[verbose] message 1message 2", ] `; @@ -620,7 +620,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 07 writeVerbose 03 writes a message with colors: output as chunks 1`] = ` Array [ - "[3] [green]message 1[default]", + "[verbose] [green]message 1[default]", ] `; @@ -636,7 +636,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 07 writeVerbose 04 writes a multiple messages with colors: output as chunks 1`] = ` Array [ - "[3] [green]message 1[default][red]message 2[default]", + "[verbose] [green]message 1[default][red]message 2[default]", ] `; @@ -652,7 +652,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 07 writeVerbose 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` Array [ - "[3] message 1[green]message 2[default]message 3[red]message 4[default]", + "[verbose] message 1[green]message 2[default]message 3[red]message 4[default]", ] `; @@ -668,7 +668,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 07 writeVerbose 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` Array [ - "[3] message 1[green]message 2[default]message 3[red]message 4[default]", + "[verbose] message 1[green]message 2[default]message 3[red]message 4[default]", ] `; @@ -684,7 +684,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 01 writes a single message: output as chunks 1`] = ` Array [ - "[3] test message[n]", + "[verbose] test message[n]", ] `; @@ -700,7 +700,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 02 writes multiple messages: output as chunks 1`] = ` Array [ - "[3] message 1message 2[n]", + "[verbose] message 1message 2[n]", ] `; @@ -716,7 +716,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 03 writes a message with colors: output as chunks 1`] = ` Array [ - "[3] [green]message 1[default][n]", + "[verbose] [green]message 1[default][n]", ] `; @@ -732,7 +732,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 04 writes a multiple messages with colors: output as chunks 1`] = ` Array [ - "[3] [green]message 1[default][red]message 2[default][n]", + "[verbose] [green]message 1[default][red]message 2[default][n]", ] `; @@ -748,7 +748,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` Array [ - "[3] message 1[green]message 2[default]message 3[red]message 4[default][n]", + "[verbose] message 1[green]message 2[default]message 3[red]message 4[default][n]", ] `; @@ -764,7 +764,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` Array [ - "[3] message 1[green]message 2[default]message 3[red]message 4[default][n]", + "[verbose] message 1[green]message 2[default]message 3[red]message 4[default][n]", ] `; @@ -780,45 +780,45 @@ Object { exports[`Terminal 01 color enabled 05 writes to multiple streams: output as chunks 1`] = ` Array [ - "[0] message 1[green]message 2[default]message 3[red]message 4[default]", - "[1] [yellow]message 1[default][yellow]message 2[default][n]", - "[3] test message", - "[3] [green]message 1[default]", - "[0] [green]message 1[default][n]", - "[2] [red]message 1[default][red]message 2[default][red]message 3[default][red]message 4[default]", - "[2] [red]test message[default][n]", - "[3] message 1[green]message 2[default]message 3[red]message 4[default][n]", - "[3] test message[n]", - "[1] [yellow]message 1[default][yellow]message 2[default]", - "[1] [yellow]message 1[default][yellow]message 2[default][yellow]message 3[default][yellow]message 4[default]", - "[2] [red]message 1[default][red]message 2[default]", - "[0] [green]message 1[default]", - "[3] message 1[green]message 2[default]message 3[red]message 4[default]", - "[2] [red]message 1[default][red]message 2[default][n]", - "[0] [green]message 1[default][red]message 2[default]", - "[3] message 1message 2", - "[3] [green]message 1[default][n]", - "[0] [green]message 1[default][red]message 2[default][n]", - "[2] [red]message 1[default]", - "[1] [yellow]message 1[default][yellow]message 2[default][yellow]message 3[default][yellow]message 4[default][n]", - "[0] test message", - "[1] [yellow]test message[default][n]", - "[3] [green]message 1[default][red]message 2[default][n]", - "[3] message 1message 2[n]", - "[2] [red]message 1[default][red]message 2[default][red]message 3[default][red]message 4[default][n]", - "[0] message 1[green]message 2[default]message 3[red]message 4[default][n]", - "[1] [yellow]message 1[default][yellow]message 2[default]", - "[2] [red]message 1[default][n]", - "[0] message 1message 2", - "[3] [green]message 1[default][red]message 2[default]", - "[1] [yellow]message 1[default]", - "[0] test message[n]", - "[2] [red]test message[default]", - "[0] message 1message 2[n]", - "[2] [red]message 1[default][red]message 2[default][n]", - "[2] [red]message 1[default][red]message 2[default]", - "[1] [yellow]message 1[default][yellow]message 2[default][n]", - "[1] [yellow]message 1[default][n]", + "[ log] message 1[green]message 2[default]message 3[red]message 4[default]", + "[warning] [yellow]message 1[default][yellow]message 2[default][n]", + "[verbose] test message", + "[verbose] [green]message 1[default]", + "[ log] [green]message 1[default][n]", + "[ error] [red]message 1[default][red]message 2[default][red]message 3[default][red]message 4[default]", + "[ error] [red]test message[default][n]", + "[verbose] message 1[green]message 2[default]message 3[red]message 4[default][n]", + "[verbose] test message[n]", + "[warning] [yellow]message 1[default][yellow]message 2[default]", + "[warning] [yellow]message 1[default][yellow]message 2[default][yellow]message 3[default][yellow]message 4[default]", + "[ error] [red]message 1[default][red]message 2[default]", + "[ log] [green]message 1[default]", + "[verbose] message 1[green]message 2[default]message 3[red]message 4[default]", + "[ error] [red]message 1[default][red]message 2[default][n]", + "[ log] [green]message 1[default][red]message 2[default]", + "[verbose] message 1message 2", + "[verbose] [green]message 1[default][n]", + "[ log] [green]message 1[default][red]message 2[default][n]", + "[ error] [red]message 1[default]", + "[warning] [yellow]message 1[default][yellow]message 2[default][yellow]message 3[default][yellow]message 4[default][n]", + "[ log] test message", + "[warning] [yellow]test message[default][n]", + "[verbose] [green]message 1[default][red]message 2[default][n]", + "[verbose] message 1message 2[n]", + "[ error] [red]message 1[default][red]message 2[default][red]message 3[default][red]message 4[default][n]", + "[ log] message 1[green]message 2[default]message 3[red]message 4[default][n]", + "[warning] [yellow]message 1[default][yellow]message 2[default]", + "[ error] [red]message 1[default][n]", + "[ log] message 1message 2", + "[verbose] [green]message 1[default][red]message 2[default]", + "[warning] [yellow]message 1[default]", + "[ log] test message[n]", + "[ error] [red]test message[default]", + "[ log] message 1message 2[n]", + "[ error] [red]message 1[default][red]message 2[default][n]", + "[ error] [red]message 1[default][red]message 2[default]", + "[warning] [yellow]message 1[default][yellow]message 2[default][n]", + "[warning] [yellow]message 1[default][n]", ] `; @@ -834,7 +834,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 01 write 01 writes a single message: output as chunks 1`] = ` Array [ - "[0] test message", + "[ log] test message", ] `; @@ -850,7 +850,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 01 write 02 writes multiple messages: output as chunks 1`] = ` Array [ - "[0] message 1message 2", + "[ log] message 1message 2", ] `; @@ -866,7 +866,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 01 write 03 writes a message with colors: output as chunks 1`] = ` Array [ - "[0] message 1", + "[ log] message 1", ] `; @@ -882,7 +882,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 01 write 04 writes a multiple messages with colors: output as chunks 1`] = ` Array [ - "[0] message 1message 2", + "[ log] message 1message 2", ] `; @@ -898,7 +898,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 01 write 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` Array [ - "[0] message 1message 2message 3message 4", + "[ log] message 1message 2message 3message 4", ] `; @@ -914,7 +914,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 01 write 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` Array [ - "[0] message 1message 2message 3message 4", + "[ log] message 1message 2message 3message 4", ] `; @@ -930,7 +930,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 01 writes a single message: output as chunks 1`] = ` Array [ - "[0] test message[n]", + "[ log] test message[n]", ] `; @@ -946,7 +946,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 02 writes multiple messages: output as chunks 1`] = ` Array [ - "[0] message 1message 2[n]", + "[ log] message 1message 2[n]", ] `; @@ -962,7 +962,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 03 writes a message with colors: output as chunks 1`] = ` Array [ - "[0] message 1[n]", + "[ log] message 1[n]", ] `; @@ -978,7 +978,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 04 writes a multiple messages with colors: output as chunks 1`] = ` Array [ - "[0] message 1message 2[n]", + "[ log] message 1message 2[n]", ] `; @@ -994,7 +994,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` Array [ - "[0] message 1message 2message 3message 4[n]", + "[ log] message 1message 2message 3message 4[n]", ] `; @@ -1010,7 +1010,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` Array [ - "[0] message 1message 2message 3message 4[n]", + "[ log] message 1message 2message 3message 4[n]", ] `; @@ -1026,7 +1026,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 03 writeWarning 01 writes a single message: output as chunks 1`] = ` Array [ - "[1] test message", + "[warning] test message", ] `; @@ -1042,7 +1042,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 03 writeWarning 02 writes multiple messages: output as chunks 1`] = ` Array [ - "[1] message 1message 2", + "[warning] message 1message 2", ] `; @@ -1058,7 +1058,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 03 writeWarning 03 writes a message with colors: output as chunks 1`] = ` Array [ - "[1] message 1", + "[warning] message 1", ] `; @@ -1074,7 +1074,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 03 writeWarning 04 writes a multiple messages with colors: output as chunks 1`] = ` Array [ - "[1] message 1message 2", + "[warning] message 1message 2", ] `; @@ -1090,7 +1090,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 03 writeWarning 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` Array [ - "[1] message 1message 2message 3message 4", + "[warning] message 1message 2message 3message 4", ] `; @@ -1106,7 +1106,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 03 writeWarning 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` Array [ - "[1] message 1message 2message 3message 4", + "[warning] message 1message 2message 3message 4", ] `; @@ -1122,7 +1122,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 01 writes a single message: output as chunks 1`] = ` Array [ - "[1] test message[n]", + "[warning] test message[n]", ] `; @@ -1138,7 +1138,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 02 writes multiple messages: output as chunks 1`] = ` Array [ - "[1] message 1message 2[n]", + "[warning] message 1message 2[n]", ] `; @@ -1154,7 +1154,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 03 writes a message with colors: output as chunks 1`] = ` Array [ - "[1] message 1[n]", + "[warning] message 1[n]", ] `; @@ -1170,7 +1170,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 04 writes a multiple messages with colors: output as chunks 1`] = ` Array [ - "[1] message 1message 2[n]", + "[warning] message 1message 2[n]", ] `; @@ -1186,7 +1186,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` Array [ - "[1] message 1message 2message 3message 4[n]", + "[warning] message 1message 2message 3message 4[n]", ] `; @@ -1202,7 +1202,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` Array [ - "[1] message 1message 2message 3message 4[n]", + "[warning] message 1message 2message 3message 4[n]", ] `; @@ -1218,7 +1218,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 05 writeError 01 writes a single message: output as chunks 1`] = ` Array [ - "[2] test message", + "[ error] test message", ] `; @@ -1234,7 +1234,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 05 writeError 02 writes multiple messages: output as chunks 1`] = ` Array [ - "[2] message 1message 2", + "[ error] message 1message 2", ] `; @@ -1250,7 +1250,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 05 writeError 03 writes a message with colors: output as chunks 1`] = ` Array [ - "[2] message 1", + "[ error] message 1", ] `; @@ -1266,7 +1266,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 05 writeError 04 writes a multiple messages with colors: output as chunks 1`] = ` Array [ - "[2] message 1message 2", + "[ error] message 1message 2", ] `; @@ -1282,7 +1282,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 05 writeError 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` Array [ - "[2] message 1message 2message 3message 4", + "[ error] message 1message 2message 3message 4", ] `; @@ -1298,7 +1298,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 05 writeError 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` Array [ - "[2] message 1message 2message 3message 4", + "[ error] message 1message 2message 3message 4", ] `; @@ -1314,7 +1314,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 01 writes a single message: output as chunks 1`] = ` Array [ - "[2] test message[n]", + "[ error] test message[n]", ] `; @@ -1330,7 +1330,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 02 writes multiple messages: output as chunks 1`] = ` Array [ - "[2] message 1message 2[n]", + "[ error] message 1message 2[n]", ] `; @@ -1346,7 +1346,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 03 writes a message with colors: output as chunks 1`] = ` Array [ - "[2] message 1[n]", + "[ error] message 1[n]", ] `; @@ -1362,7 +1362,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 04 writes a multiple messages with colors: output as chunks 1`] = ` Array [ - "[2] message 1message 2[n]", + "[ error] message 1message 2[n]", ] `; @@ -1378,7 +1378,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` Array [ - "[2] message 1message 2message 3message 4[n]", + "[ error] message 1message 2message 3message 4[n]", ] `; @@ -1394,7 +1394,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` Array [ - "[2] message 1message 2message 3message 4[n]", + "[ error] message 1message 2message 3message 4[n]", ] `; @@ -1410,7 +1410,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 07 writeVerbose 01 writes a single message: output as chunks 1`] = ` Array [ - "[3] test message", + "[verbose] test message", ] `; @@ -1426,7 +1426,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 07 writeVerbose 02 writes multiple messages: output as chunks 1`] = ` Array [ - "[3] message 1message 2", + "[verbose] message 1message 2", ] `; @@ -1442,7 +1442,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 07 writeVerbose 03 writes a message with colors: output as chunks 1`] = ` Array [ - "[3] message 1", + "[verbose] message 1", ] `; @@ -1458,7 +1458,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 07 writeVerbose 04 writes a multiple messages with colors: output as chunks 1`] = ` Array [ - "[3] message 1message 2", + "[verbose] message 1message 2", ] `; @@ -1474,7 +1474,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 07 writeVerbose 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` Array [ - "[3] message 1message 2message 3message 4", + "[verbose] message 1message 2message 3message 4", ] `; @@ -1490,7 +1490,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 07 writeVerbose 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` Array [ - "[3] message 1message 2message 3message 4", + "[verbose] message 1message 2message 3message 4", ] `; @@ -1506,7 +1506,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 01 writes a single message: output as chunks 1`] = ` Array [ - "[3] test message[n]", + "[verbose] test message[n]", ] `; @@ -1522,7 +1522,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 02 writes multiple messages: output as chunks 1`] = ` Array [ - "[3] message 1message 2[n]", + "[verbose] message 1message 2[n]", ] `; @@ -1538,7 +1538,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 03 writes a message with colors: output as chunks 1`] = ` Array [ - "[3] message 1[n]", + "[verbose] message 1[n]", ] `; @@ -1554,7 +1554,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 04 writes a multiple messages with colors: output as chunks 1`] = ` Array [ - "[3] message 1message 2[n]", + "[verbose] message 1message 2[n]", ] `; @@ -1570,7 +1570,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` Array [ - "[3] message 1message 2message 3message 4[n]", + "[verbose] message 1message 2message 3message 4[n]", ] `; @@ -1586,7 +1586,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` Array [ - "[3] message 1message 2message 3message 4[n]", + "[verbose] message 1message 2message 3message 4[n]", ] `; @@ -1602,7 +1602,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 09 writeDebug 01 writes a single message: output as chunks 1`] = ` Array [ - "[4] test message", + "[ debug] test message", ] `; @@ -1618,7 +1618,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 09 writeDebug 02 writes multiple messages: output as chunks 1`] = ` Array [ - "[4] message 1message 2", + "[ debug] message 1message 2", ] `; @@ -1634,7 +1634,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 09 writeDebug 03 writes a message with colors: output as chunks 1`] = ` Array [ - "[4] message 1", + "[ debug] message 1", ] `; @@ -1650,7 +1650,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 09 writeDebug 04 writes a multiple messages with colors: output as chunks 1`] = ` Array [ - "[4] message 1message 2", + "[ debug] message 1message 2", ] `; @@ -1666,7 +1666,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 09 writeDebug 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` Array [ - "[4] message 1message 2message 3message 4", + "[ debug] message 1message 2message 3message 4", ] `; @@ -1682,7 +1682,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 09 writeDebug 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` Array [ - "[4] message 1message 2message 3message 4", + "[ debug] message 1message 2message 3message 4", ] `; @@ -1698,7 +1698,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 01 writes a single message: output as chunks 1`] = ` Array [ - "[4] test message[n]", + "[ debug] test message[n]", ] `; @@ -1714,7 +1714,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 02 writes multiple messages: output as chunks 1`] = ` Array [ - "[4] message 1message 2[n]", + "[ debug] message 1message 2[n]", ] `; @@ -1730,7 +1730,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 03 writes a message with colors: output as chunks 1`] = ` Array [ - "[4] message 1[n]", + "[ debug] message 1[n]", ] `; @@ -1746,7 +1746,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 04 writes a multiple messages with colors: output as chunks 1`] = ` Array [ - "[4] message 1message 2[n]", + "[ debug] message 1message 2[n]", ] `; @@ -1762,7 +1762,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` Array [ - "[4] message 1message 2message 3message 4[n]", + "[ debug] message 1message 2message 3message 4[n]", ] `; @@ -1778,7 +1778,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` Array [ - "[4] message 1message 2message 3message 4[n]", + "[ debug] message 1message 2message 3message 4[n]", ] `; @@ -1794,44 +1794,44 @@ Object { exports[`Terminal 02 color disabled 05 writes to multiple streams: output as chunks 1`] = ` Array [ - "[0] message 1message 2message 3message 4", - "[1] message 1message 2[n]", - "[3] test message", - "[3] message 1", - "[0] message 1[n]", - "[2] message 1message 2message 3message 4", - "[2] test message[n]", - "[3] message 1message 2message 3message 4[n]", - "[3] test message[n]", - "[1] message 1message 2", - "[1] message 1message 2message 3message 4", - "[2] message 1message 2", - "[0] message 1", - "[3] message 1message 2message 3message 4", - "[2] message 1message 2[n]", - "[0] message 1message 2", - "[3] message 1message 2", - "[3] message 1[n]", - "[0] message 1message 2[n]", - "[2] message 1", - "[1] message 1message 2message 3message 4[n]", - "[0] test message", - "[1] test message[n]", - "[3] message 1message 2[n]", - "[3] message 1message 2[n]", - "[2] message 1message 2message 3message 4[n]", - "[0] message 1message 2message 3message 4[n]", - "[1] message 1message 2", - "[2] message 1[n]", - "[0] message 1message 2", - "[3] message 1message 2", - "[1] message 1", - "[0] test message[n]", - "[2] test message", - "[0] message 1message 2[n]", - "[2] message 1message 2[n]", - "[2] message 1message 2", - "[1] message 1message 2[n]", - "[1] message 1[n]", + "[ log] message 1message 2message 3message 4", + "[warning] message 1message 2[n]", + "[verbose] test message", + "[verbose] message 1", + "[ log] message 1[n]", + "[ error] message 1message 2message 3message 4", + "[ error] test message[n]", + "[verbose] message 1message 2message 3message 4[n]", + "[verbose] test message[n]", + "[warning] message 1message 2", + "[warning] message 1message 2message 3message 4", + "[ error] message 1message 2", + "[ log] message 1", + "[verbose] message 1message 2message 3message 4", + "[ error] message 1message 2[n]", + "[ log] message 1message 2", + "[verbose] message 1message 2", + "[verbose] message 1[n]", + "[ log] message 1message 2[n]", + "[ error] message 1", + "[warning] message 1message 2message 3message 4[n]", + "[ log] test message", + "[warning] test message[n]", + "[verbose] message 1message 2[n]", + "[verbose] message 1message 2[n]", + "[ error] message 1message 2message 3message 4[n]", + "[ log] message 1message 2message 3message 4[n]", + "[warning] message 1message 2", + "[ error] message 1[n]", + "[ log] message 1message 2", + "[verbose] message 1message 2", + "[warning] message 1", + "[ log] test message[n]", + "[ error] test message", + "[ log] message 1message 2[n]", + "[ error] message 1message 2[n]", + "[ error] message 1message 2", + "[warning] message 1message 2[n]", + "[warning] message 1[n]", ] `; diff --git a/rush-plugins/rush-http-build-cache-plugin/src/test/HttpBuildCacheProvider.test.ts b/rush-plugins/rush-http-build-cache-plugin/src/test/HttpBuildCacheProvider.test.ts index 0e5258eca9..5629e2e26a 100644 --- a/rush-plugins/rush-http-build-cache-plugin/src/test/HttpBuildCacheProvider.test.ts +++ b/rush-plugins/rush-http-build-cache-plugin/src/test/HttpBuildCacheProvider.test.ts @@ -66,8 +66,7 @@ describe('HttpBuildCacheProvider', () => { redirect: 'follow' }) ); - expect(terminalBuffer.getAllOutputAsChunks({ asFlat: true, severityAsNames: true })) - .toMatchInlineSnapshot(` + expect(terminalBuffer.getAllOutputAsChunks({ asFlat: true })).toMatchInlineSnapshot(` Array [ "[ debug] [http-build-cache] request: GET https://buildcache.example.acme.com/some-key unknown bytes[n]", "[warning] Error getting cache entry: Error: Credentials for https://buildcache.example.acme.com/ have not been provided.[n]In CI, verify that RUSH_BUILD_CACHE_CREDENTIAL contains a valid Authorization header value.[n][n]For local developers, run:[n][n] rush update-cloud-credentials --interactive[n][n]", @@ -124,8 +123,7 @@ Array [ redirect: 'follow' }) ); - expect(terminalBuffer.getAllOutputAsChunks({ asFlat: true, severityAsNames: true })) - .toMatchInlineSnapshot(` + expect(terminalBuffer.getAllOutputAsChunks({ asFlat: true })).toMatchInlineSnapshot(` Array [ "[ debug] [http-build-cache] request: GET https://buildcache.example.acme.com/some-key unknown bytes[n]", "[ debug] [http-build-cache] request: GET https://buildcache.example.acme.com/some-key unknown bytes[n]", From d569da2b6def0e7d8db3f694c784a6b2f54affb4 Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Sat, 3 Jan 2026 22:54:32 -0500 Subject: [PATCH 08/14] fixup! Update tests to use StringBufferTerminalProvider.getAllOutputAsChunks. --- .../rush-lib/src/api/test/CustomTipsConfiguration.test.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libraries/rush-lib/src/api/test/CustomTipsConfiguration.test.ts b/libraries/rush-lib/src/api/test/CustomTipsConfiguration.test.ts index 469cd8ea32..284106bbf3 100644 --- a/libraries/rush-lib/src/api/test/CustomTipsConfiguration.test.ts +++ b/libraries/rush-lib/src/api/test/CustomTipsConfiguration.test.ts @@ -6,8 +6,7 @@ import { type IOutputChunk, PrintUtilities, StringBufferTerminalProvider, - Terminal, - type TerminalProviderSeverityName + Terminal } from '@rushstack/terminal'; import { CustomTipId, CustomTipsConfiguration, type ICustomTipsJson } from '../CustomTipsConfiguration'; From 67487c0c52c00ec9c51bf18edebb86e0d7a3e3a7 Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Sun, 4 Jan 2026 20:24:19 -0500 Subject: [PATCH 09/14] Eliminate variadic function invocation. Co-authored-by: David Michon --- libraries/terminal/src/StringBufferTerminalProvider.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libraries/terminal/src/StringBufferTerminalProvider.ts b/libraries/terminal/src/StringBufferTerminalProvider.ts index df3077ab71..b709e7d995 100644 --- a/libraries/terminal/src/StringBufferTerminalProvider.ts +++ b/libraries/terminal/src/StringBufferTerminalProvider.ts @@ -69,9 +69,7 @@ function _normalizeOutput(s: string, options: IStringBufferOutputOptions | undef } } -const LONGEST_SEVERITY_NAME_LENGTH: number = Math.max( - ...Object.keys(TerminalProviderSeverity).map(({ length }) => length) -); +const LONGEST_SEVERITY_NAME_LENGTH: number = Object.keys(TerminalProviderSeverity).reduce((max: number, k: string) => Math.max(max, k.length), 0); /** * Terminal provider that stores written data in buffers separated by severity. From 709d25eb553c7bf8df138f396deefc349e305d33 Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Sun, 4 Jan 2026 20:24:39 -0500 Subject: [PATCH 10/14] fixup! Eliminate variadic function invocation. --- libraries/terminal/src/StringBufferTerminalProvider.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libraries/terminal/src/StringBufferTerminalProvider.ts b/libraries/terminal/src/StringBufferTerminalProvider.ts index b709e7d995..b5232543c4 100644 --- a/libraries/terminal/src/StringBufferTerminalProvider.ts +++ b/libraries/terminal/src/StringBufferTerminalProvider.ts @@ -69,7 +69,10 @@ function _normalizeOutput(s: string, options: IStringBufferOutputOptions | undef } } -const LONGEST_SEVERITY_NAME_LENGTH: number = Object.keys(TerminalProviderSeverity).reduce((max: number, k: string) => Math.max(max, k.length), 0); +const LONGEST_SEVERITY_NAME_LENGTH: number = Object.keys(TerminalProviderSeverity).reduce( + (max: number, k: string) => Math.max(max, k.length), + 0 +); /** * Terminal provider that stores written data in buffers separated by severity. From f94b7aeb4c1c621332f9ea26919f89d4751ad271 Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Mon, 5 Jan 2026 23:23:58 -0500 Subject: [PATCH 11/14] Combine sequential logging statements in getAllOutputAsChunks and replace 'asFlat' with 'asLines' --- common/reviews/api/terminal.api.md | 6 +- .../src/test/ConfigurationFile.test.ts | 2 +- .../ConfigurationFile.test.ts.snap | 36 +- .../test/__snapshots__/parseResx.test.ts.snap | 6 +- .../src/parsers/test/parseResx.test.ts | 2 +- .../test/OperationExecutionManager.test.ts | 18 +- .../OperationExecutionManager.test.ts.snap | 18 +- .../api/test/RushProjectConfiguration.test.ts | 4 +- .../CustomTipsConfiguration.test.ts.snap | 45 - .../RushProjectConfiguration.test.ts.snap | 8 +- .../operations/test/BuildPlanPlugin.test.ts | 2 +- .../test/OperationMetadataManager.test.ts | 6 +- .../BuildPlanPlugin.test.ts.snap | 904 +++++++----------- .../OperationMetadataManager.test.ts.snap | 12 +- .../pnpm/test/PnpmShrinkwrapFile.test.ts | 2 +- .../PnpmShrinkwrapFile.test.ts.snap | 3 +- .../src/logic/test/InstallHelpers.test.ts | 2 +- .../test/ProjectImpactGraphGenerator.test.ts | 2 +- .../ProjectImpactGraphGenerator.test.ts.snap | 12 +- .../src/StringBufferTerminalProvider.ts | 60 +- .../test/PrefixProxyTerminalProvider.test.ts | 2 +- libraries/terminal/src/test/Terminal.test.ts | 2 +- .../PrefixProxyTerminalProvider.test.ts.snap | 96 +- .../test/__snapshots__/Terminal.test.ts.snap | 200 ++-- .../src/test/HttpBuildCacheProvider.test.ts | 22 +- 25 files changed, 591 insertions(+), 881 deletions(-) diff --git a/common/reviews/api/terminal.api.md b/common/reviews/api/terminal.api.md index 72443eb5f5..97c5691622 100644 --- a/common/reviews/api/terminal.api.md +++ b/common/reviews/api/terminal.api.md @@ -202,7 +202,7 @@ export interface IStdioSummarizerOptions extends ITerminalWritableOptions { // @beta (undocumented) export interface IStringBufferOutputChunksOptions extends IStringBufferOutputOptions { - asFlat?: boolean; + asLines?: boolean; } // @beta (undocumented) @@ -395,11 +395,11 @@ export class StringBufferTerminalProvider implements ITerminalProvider { // (undocumented) getAllOutput(sparse: true, options?: IStringBufferOutputOptions): Partial; getAllOutputAsChunks(options?: IStringBufferOutputChunksOptions & { - asFlat?: false; + asLines?: false; }): IOutputChunk[]; // (undocumented) getAllOutputAsChunks(options: IStringBufferOutputChunksOptions & { - asFlat: true; + asLines: true; }): `[${string}] ${string}`[]; getDebugOutput(options?: IStringBufferOutputOptions): string; getErrorOutput(options?: IStringBufferOutputOptions): string; diff --git a/libraries/heft-config-file/src/test/ConfigurationFile.test.ts b/libraries/heft-config-file/src/test/ConfigurationFile.test.ts index aead730280..1d4b4b33f5 100644 --- a/libraries/heft-config-file/src/test/ConfigurationFile.test.ts +++ b/libraries/heft-config-file/src/test/ConfigurationFile.test.ts @@ -26,7 +26,7 @@ describe('ConfigurationFile', () => { }); afterEach(() => { - expect(terminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot(); + expect(terminalProvider.getAllOutputAsChunks({ asLines: true })).toMatchSnapshot(); }); describe('A simple config file', () => { diff --git a/libraries/heft-config-file/src/test/__snapshots__/ConfigurationFile.test.ts.snap b/libraries/heft-config-file/src/test/__snapshots__/ConfigurationFile.test.ts.snap index 5c90062d35..4f390113ca 100644 --- a/libraries/heft-config-file/src/test/__snapshots__/ConfigurationFile.test.ts.snap +++ b/libraries/heft-config-file/src/test/__snapshots__/ConfigurationFile.test.ts.snap @@ -176,7 +176,7 @@ exports[`ConfigurationFile error cases Throws an error when a requested file doe exports[`ConfigurationFile error cases Throws an error when a requested file doesn't exist 2`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/errorCases/folderThatDoesntExist/config.json\\" not found.[n]", + "[ debug] Configuration file \\"/lib/test/errorCases/folderThatDoesntExist/config.json\\" not found.", ] `; @@ -184,7 +184,7 @@ exports[`ConfigurationFile error cases Throws an error when a requested file doe exports[`ConfigurationFile error cases Throws an error when a requested file doesn't exist async 2`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/errorCases/folderThatDoesntExist/config.json\\" not found.[n]", + "[ debug] Configuration file \\"/lib/test/errorCases/folderThatDoesntExist/config.json\\" not found.", ] `; @@ -192,7 +192,7 @@ exports[`ConfigurationFile error cases Throws an error when an "extends" propert exports[`ConfigurationFile error cases Throws an error when an "extends" property points to a file that cannot be resolved 2`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/errorCases/extendsNotExist/config2.json\\" not found.[n]", + "[ debug] Configuration file \\"/lib/test/errorCases/extendsNotExist/config2.json\\" not found.", ] `; @@ -200,7 +200,7 @@ exports[`ConfigurationFile error cases Throws an error when an "extends" propert exports[`ConfigurationFile error cases Throws an error when an "extends" property points to a file that cannot be resolved async 2`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/errorCases/extendsNotExist/config2.json\\" not found.[n]", + "[ debug] Configuration file \\"/lib/test/errorCases/extendsNotExist/config2.json\\" not found.", ] `; @@ -218,13 +218,13 @@ exports[`ConfigurationFile error cases Throws an error when there is a circular exports[`ConfigurationFile error cases returns undefined when the file doesn't exist for tryLoadConfigurationFileForProject 1`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/errorCases/invalidType/notExist.json\\" not found.[n]", + "[ debug] Configuration file \\"/lib/test/errorCases/invalidType/notExist.json\\" not found.", ] `; exports[`ConfigurationFile error cases returns undefined when the file doesn't exist for tryLoadConfigurationFileForProjectAsync 1`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/errorCases/invalidType/notExist.json\\" not found.[n]", + "[ debug] Configuration file \\"/lib/test/errorCases/invalidType/notExist.json\\" not found.", ] `; @@ -232,7 +232,7 @@ exports[`ConfigurationFile error cases throws an error when the file doesn't exi exports[`ConfigurationFile error cases throws an error when the file doesn't exist 2`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/errorCases/invalidType/notExist.json\\" not found.[n]", + "[ debug] Configuration file \\"/lib/test/errorCases/invalidType/notExist.json\\" not found.", ] `; @@ -240,31 +240,31 @@ exports[`ConfigurationFile error cases throws an error when the file doesn't exi exports[`ConfigurationFile error cases throws an error when the file doesn't exist async 2`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/errorCases/invalidType/notExist.json\\" not found.[n]", + "[ debug] Configuration file \\"/lib/test/errorCases/invalidType/notExist.json\\" not found.", ] `; exports[`ConfigurationFile loading a rig correctly loads a config file inside a rig 1`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/simplestConfigFile.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").[n]", + "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/simplestConfigFile.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").", ] `; exports[`ConfigurationFile loading a rig correctly loads a config file inside a rig async 1`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/simplestConfigFile.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").[n]", + "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/simplestConfigFile.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").", ] `; exports[`ConfigurationFile loading a rig correctly loads a config file inside a rig via tryLoadConfigurationFileForProject 1`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/simplestConfigFile.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").[n]", + "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/simplestConfigFile.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").", ] `; exports[`ConfigurationFile loading a rig correctly loads a config file inside a rig via tryLoadConfigurationFileForProjectAsync 1`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/simplestConfigFile.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").[n]", + "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/simplestConfigFile.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").", ] `; @@ -272,9 +272,9 @@ exports[`ConfigurationFile loading a rig throws an error when a config file does exports[`ConfigurationFile loading a rig throws an error when a config file doesn't exist in a project referencing a rig, which also doesn't have the file 2`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/notExist.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").[n]", - "[ debug] Configuration file \\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default/config/notExist.json\\" not found.[n]", - "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/notExist.json\\" not found.[n]", + "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/notExist.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").", + "[ debug] Configuration file \\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default/config/notExist.json\\" not found.", + "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/notExist.json\\" not found.", ] `; @@ -282,8 +282,8 @@ exports[`ConfigurationFile loading a rig throws an error when a config file does exports[`ConfigurationFile loading a rig throws an error when a config file doesn't exist in a project referencing a rig, which also doesn't have the file async 2`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/notExist.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").[n]", - "[ debug] Configuration file \\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default/config/notExist.json\\" not found.[n]", - "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/notExist.json\\" not found.[n]", + "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/notExist.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").", + "[ debug] Configuration file \\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default/config/notExist.json\\" not found.", + "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/notExist.json\\" not found.", ] `; diff --git a/libraries/localization-utilities/src/parsers/test/__snapshots__/parseResx.test.ts.snap b/libraries/localization-utilities/src/parsers/test/__snapshots__/parseResx.test.ts.snap index 8eabd6e39c..f826c6d390 100644 --- a/libraries/localization-utilities/src/parsers/test/__snapshots__/parseResx.test.ts.snap +++ b/libraries/localization-utilities/src/parsers/test/__snapshots__/parseResx.test.ts.snap @@ -35,7 +35,7 @@ Object { exports[`parseResx fails to parse a RESX file with a duplicate string: terminal output 1`] = ` Array [ - "[ error] test.resx(6,45): Duplicate string value \\"stringA\\"[n]", + "[ error] test.resx(6,45): Duplicate string value \\"stringA\\"", ] `; @@ -50,7 +50,7 @@ Object { exports[`parseResx ignoreMissingResxComments when set to false, warns on a missing comment: terminal output 1`] = ` Array [ - "[warning] test.resx(3,59): Missing string comment in element[n]", + "[warning] test.resx(3,59): Missing string comment in element", ] `; @@ -113,7 +113,7 @@ Object { exports[`parseResx prints an error on invalid XML: terminal output 1`] = ` Array [ - "[ error] test.resx(3,41): Found unexpected non-empty text node in RESX element[n]", + "[ error] test.resx(3,41): Found unexpected non-empty text node in RESX element", ] `; diff --git a/libraries/localization-utilities/src/parsers/test/parseResx.test.ts b/libraries/localization-utilities/src/parsers/test/parseResx.test.ts index a1ac48fdd4..7a241d54cc 100644 --- a/libraries/localization-utilities/src/parsers/test/parseResx.test.ts +++ b/libraries/localization-utilities/src/parsers/test/parseResx.test.ts @@ -16,7 +16,7 @@ describe(parseResx.name, () => { }); afterEach(() => { - expect(terminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot('terminal output'); + expect(terminalProvider.getAllOutputAsChunks({ asLines: true })).toMatchSnapshot('terminal output'); }); async function testResxAsync( diff --git a/libraries/operation-graph/src/test/OperationExecutionManager.test.ts b/libraries/operation-graph/src/test/OperationExecutionManager.test.ts index 137d814410..bdd635afde 100644 --- a/libraries/operation-graph/src/test/OperationExecutionManager.test.ts +++ b/libraries/operation-graph/src/test/OperationExecutionManager.test.ts @@ -68,7 +68,7 @@ describe(OperationExecutionManager.name, () => { }); expect(result).toBe(OperationStatus.NoOp); - expect(terminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot(); + expect(terminalProvider.getAllOutputAsChunks({ asLines: true })).toMatchSnapshot(); }); it('handles trivial input', async () => { @@ -87,7 +87,7 @@ describe(OperationExecutionManager.name, () => { }); expect(result).toBe(OperationStatus.Success); - expect(terminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot(); + expect(terminalProvider.getAllOutputAsChunks({ asLines: true })).toMatchSnapshot(); expect(operation.state?.status).toBe(OperationStatus.NoOp); }); @@ -135,7 +135,7 @@ describe(OperationExecutionManager.name, () => { }); expect(result).toBe(OperationStatus.Success); - expect(terminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot(); + expect(terminalProvider.getAllOutputAsChunks({ asLines: true })).toMatchSnapshot(); expect(runAlpha).toHaveBeenCalledTimes(1); expect(runBeta).toHaveBeenCalledTimes(1); @@ -187,7 +187,7 @@ describe(OperationExecutionManager.name, () => { }); expect(result).toBe(OperationStatus.Failure); - expect(terminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot(); + expect(terminalProvider.getAllOutputAsChunks({ asLines: true })).toMatchSnapshot(); expect(runAlpha).toHaveBeenCalledTimes(1); expect(runBeta).toHaveBeenCalledTimes(0); @@ -218,7 +218,7 @@ describe(OperationExecutionManager.name, () => { }); expect(result).toBe(OperationStatus.NoOp); - expect(terminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot(); + expect(terminalProvider.getAllOutputAsChunks({ asLines: true })).toMatchSnapshot(); }); it('respects priority order', async () => { @@ -271,7 +271,7 @@ describe(OperationExecutionManager.name, () => { expect(executed).toEqual([beta, alpha]); expect(result).toBe(OperationStatus.Success); - expect(terminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot(); + expect(terminalProvider.getAllOutputAsChunks({ asLines: true })).toMatchSnapshot(); expect(runAlpha).toHaveBeenCalledTimes(1); expect(runBeta).toHaveBeenCalledTimes(1); @@ -324,7 +324,7 @@ describe(OperationExecutionManager.name, () => { }); expect(result).toBe(OperationStatus.Success); - expect(terminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot(); + expect(terminalProvider.getAllOutputAsChunks({ asLines: true })).toMatchSnapshot(); expect(run).toHaveBeenCalledTimes(2); @@ -391,7 +391,7 @@ describe(OperationExecutionManager.name, () => { expect(betaRequestRun).toBeDefined(); expect(result1).toBe(OperationStatus.Success); - expect(terminalProvider1.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot('first'); + expect(terminalProvider1.getAllOutputAsChunks({ asLines: true })).toMatchSnapshot('first'); expect(runAlpha).toHaveBeenCalledTimes(1); expect(runBeta).toHaveBeenCalledTimes(1); @@ -423,7 +423,7 @@ describe(OperationExecutionManager.name, () => { }); expect(result2).toBe(OperationStatus.Success); - expect(terminalProvider2.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot('second'); + expect(terminalProvider2.getAllOutputAsChunks({ asLines: true })).toMatchSnapshot('second'); expect(runAlpha).toHaveBeenCalledTimes(2); expect(runBeta).toHaveBeenCalledTimes(2); diff --git a/libraries/operation-graph/src/test/__snapshots__/OperationExecutionManager.test.ts.snap b/libraries/operation-graph/src/test/__snapshots__/OperationExecutionManager.test.ts.snap index 34db93d6c8..9c845afe5f 100644 --- a/libraries/operation-graph/src/test/__snapshots__/OperationExecutionManager.test.ts.snap +++ b/libraries/operation-graph/src/test/__snapshots__/OperationExecutionManager.test.ts.snap @@ -4,54 +4,54 @@ exports[`OperationExecutionManager constructor throws if a dependency is not in exports[`OperationExecutionManager executeAsync single pass blocks on failure 1`] = ` Array [ - "[verbose] Executing a maximum of 1 simultaneous tasks...[n]", + "[verbose] Executing a maximum of 1 simultaneous tasks...", ] `; exports[`OperationExecutionManager executeAsync single pass does not track noops 1`] = ` Array [ - "[verbose] Executing a maximum of 1 simultaneous tasks...[n]", + "[verbose] Executing a maximum of 1 simultaneous tasks...", ] `; exports[`OperationExecutionManager executeAsync single pass executes in order 1`] = ` Array [ - "[verbose] Executing a maximum of 1 simultaneous tasks...[n]", + "[verbose] Executing a maximum of 1 simultaneous tasks...", ] `; exports[`OperationExecutionManager executeAsync single pass handles empty input 1`] = ` Array [ - "[verbose] Executing a maximum of 0 simultaneous tasks...[n]", + "[verbose] Executing a maximum of 0 simultaneous tasks...", ] `; exports[`OperationExecutionManager executeAsync single pass handles trivial input 1`] = ` Array [ - "[verbose] Executing a maximum of 1 simultaneous tasks...[n]", + "[verbose] Executing a maximum of 1 simultaneous tasks...", ] `; exports[`OperationExecutionManager executeAsync single pass respects concurrency 1`] = ` Array [ - "[verbose] Executing a maximum of 2 simultaneous tasks...[n]", + "[verbose] Executing a maximum of 2 simultaneous tasks...", ] `; exports[`OperationExecutionManager executeAsync single pass respects priority order 1`] = ` Array [ - "[verbose] Executing a maximum of 1 simultaneous tasks...[n]", + "[verbose] Executing a maximum of 1 simultaneous tasks...", ] `; exports[`OperationExecutionManager executeAsync watch mode executes in order: first 1`] = ` Array [ - "[verbose] Executing a maximum of 1 simultaneous tasks...[n]", + "[verbose] Executing a maximum of 1 simultaneous tasks...", ] `; exports[`OperationExecutionManager executeAsync watch mode executes in order: second 1`] = ` Array [ - "[verbose] Executing a maximum of 1 simultaneous tasks...[n]", + "[verbose] Executing a maximum of 1 simultaneous tasks...", ] `; diff --git a/libraries/rush-lib/src/api/test/RushProjectConfiguration.test.ts b/libraries/rush-lib/src/api/test/RushProjectConfiguration.test.ts index 7a509dee81..e3f676c508 100644 --- a/libraries/rush-lib/src/api/test/RushProjectConfiguration.test.ts +++ b/libraries/rush-lib/src/api/test/RushProjectConfiguration.test.ts @@ -63,7 +63,7 @@ function validateConfiguration(rushProjectConfiguration: RushProjectConfiguratio terminal ); } finally { - expect(terminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot(); + expect(terminalProvider.getAllOutputAsChunks({ asLines: true })).toMatchSnapshot(); } } } @@ -90,7 +90,7 @@ function validateConfigurationWithParameters( terminal ); } finally { - expect(terminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot(); + expect(terminalProvider.getAllOutputAsChunks({ asLines: true })).toMatchSnapshot(); } } } diff --git a/libraries/rush-lib/src/api/test/__snapshots__/CustomTipsConfiguration.test.ts.snap b/libraries/rush-lib/src/api/test/__snapshots__/CustomTipsConfiguration.test.ts.snap index 0f38385666..c89bc2b9c4 100644 --- a/libraries/rush-lib/src/api/test/__snapshots__/CustomTipsConfiguration.test.ts.snap +++ b/libraries/rush-lib/src/api/test/__snapshots__/CustomTipsConfiguration.test.ts.snap @@ -3,9 +3,7 @@ exports[`CustomTipsConfiguration formatting (a long message with an indented line) _showErrorTip prints an expected message 1`] = ` Array [ "[error] [red]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", - "[error] ", "[error] [red]|[default]", - "[error] ", "[error] [red]| [default]Lorem ipsum dolor sit amet, consectetur", "[error] [red]| [default]adipiscing elit, sed do eiusmod tempor", "[error] [red]| [default]incididunt ut labore et dolore magna aliqua. Ut", @@ -35,9 +33,7 @@ Array [ exports[`CustomTipsConfiguration formatting (a long message with an indented line) _showInfoTip prints an expected message 1`] = ` Array [ "[log] | Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)", - "[log] ", "[log] |", - "[log] ", "[log] | Lorem ipsum dolor sit amet, consectetur adipiscing elit,", "[log] | sed do eiusmod tempor incididunt ut labore et dolore magna", "[log] | aliqua. Ut enim ad minim veniam, quis nostrud exercitation", @@ -56,16 +52,13 @@ Array [ "[log] | officia deserunt mollit anim id est laborum.", "[log] ", "[log] ", - "[log] ", ] `; exports[`CustomTipsConfiguration formatting (a long message with an indented line) _showTip prints an expected message 1`] = ` Array [ "[error] [red]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", - "[error] ", "[error] [red]|[default]", - "[error] ", "[error] [red]| [default]Lorem ipsum dolor sit amet, consectetur", "[error] [red]| [default]adipiscing elit, sed do eiusmod tempor", "[error] [red]| [default]incididunt ut labore et dolore magna aliqua. Ut", @@ -95,9 +88,7 @@ Array [ exports[`CustomTipsConfiguration formatting (a long message with an indented line) _showWarningTip prints an expected message 1`] = ` Array [ "[warning] [yellow]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", - "[warning] ", "[warning] [yellow]|[default]", - "[warning] ", "[warning] [yellow]| [default]Lorem ipsum dolor sit amet, consectetur", "[warning] [yellow]| [default]adipiscing elit, sed do eiusmod tempor", "[warning] [yellow]| [default]incididunt ut labore et dolore magna aliqua. Ut", @@ -127,9 +118,7 @@ Array [ exports[`CustomTipsConfiguration formatting (a long message) _showErrorTip prints an expected message 1`] = ` Array [ "[error] [red]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", - "[error] ", "[error] [red]|[default]", - "[error] ", "[error] [red]| [default]Lorem ipsum dolor sit amet, consectetur", "[error] [red]| [default]adipiscing elit, sed do eiusmod tempor", "[error] [red]| [default]incididunt ut labore et dolore magna aliqua. Ut", @@ -149,9 +138,7 @@ Array [ exports[`CustomTipsConfiguration formatting (a long message) _showInfoTip prints an expected message 1`] = ` Array [ "[log] | Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)", - "[log] ", "[log] |", - "[log] ", "[log] | Lorem ipsum dolor sit amet, consectetur adipiscing elit,", "[log] | sed do eiusmod tempor incididunt ut labore et dolore magna", "[log] | aliqua. Ut enim ad minim veniam, quis nostrud exercitation", @@ -162,16 +149,13 @@ Array [ "[log] | officia deserunt mollit anim id est laborum.", "[log] ", "[log] ", - "[log] ", ] `; exports[`CustomTipsConfiguration formatting (a long message) _showTip prints an expected message 1`] = ` Array [ "[error] [red]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", - "[error] ", "[error] [red]|[default]", - "[error] ", "[error] [red]| [default]Lorem ipsum dolor sit amet, consectetur", "[error] [red]| [default]adipiscing elit, sed do eiusmod tempor", "[error] [red]| [default]incididunt ut labore et dolore magna aliqua. Ut", @@ -191,9 +175,7 @@ Array [ exports[`CustomTipsConfiguration formatting (a long message) _showWarningTip prints an expected message 1`] = ` Array [ "[warning] [yellow]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", - "[warning] ", "[warning] [yellow]|[default]", - "[warning] ", "[warning] [yellow]| [default]Lorem ipsum dolor sit amet, consectetur", "[warning] [yellow]| [default]adipiscing elit, sed do eiusmod tempor", "[warning] [yellow]| [default]incididunt ut labore et dolore magna aliqua. Ut", @@ -213,9 +195,7 @@ Array [ exports[`CustomTipsConfiguration formatting (a message with an indented line) _showErrorTip prints an expected message 1`] = ` Array [ "[error] [red]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", - "[error] ", "[error] [red]|[default]", - "[error] ", "[error] [red]| [default]This is a test", "[error] [red]| [default] This is a test", "[error] ", @@ -227,23 +207,18 @@ Array [ exports[`CustomTipsConfiguration formatting (a message with an indented line) _showInfoTip prints an expected message 1`] = ` Array [ "[log] | Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)", - "[log] ", "[log] |", - "[log] ", "[log] | This is a test", "[log] | This is a test", "[log] ", "[log] ", - "[log] ", ] `; exports[`CustomTipsConfiguration formatting (a message with an indented line) _showTip prints an expected message 1`] = ` Array [ "[error] [red]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", - "[error] ", "[error] [red]|[default]", - "[error] ", "[error] [red]| [default]This is a test", "[error] [red]| [default] This is a test", "[error] ", @@ -255,9 +230,7 @@ Array [ exports[`CustomTipsConfiguration formatting (a message with an indented line) _showWarningTip prints an expected message 1`] = ` Array [ "[warning] [yellow]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", - "[warning] ", "[warning] [yellow]|[default]", - "[warning] ", "[warning] [yellow]| [default]This is a test", "[warning] [yellow]| [default] This is a test", "[warning] ", @@ -269,9 +242,7 @@ Array [ exports[`CustomTipsConfiguration formatting (a message with newlines) _showErrorTip prints an expected message 1`] = ` Array [ "[error] [red]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", - "[error] ", "[error] [red]|[default]", - "[error] ", "[error] [red]| [default]This is a test", "[error] [red]| [default]This is a test", "[error] ", @@ -283,23 +254,18 @@ Array [ exports[`CustomTipsConfiguration formatting (a message with newlines) _showInfoTip prints an expected message 1`] = ` Array [ "[log] | Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)", - "[log] ", "[log] |", - "[log] ", "[log] | This is a test", "[log] | This is a test", "[log] ", "[log] ", - "[log] ", ] `; exports[`CustomTipsConfiguration formatting (a message with newlines) _showTip prints an expected message 1`] = ` Array [ "[error] [red]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", - "[error] ", "[error] [red]|[default]", - "[error] ", "[error] [red]| [default]This is a test", "[error] [red]| [default]This is a test", "[error] ", @@ -311,9 +277,7 @@ Array [ exports[`CustomTipsConfiguration formatting (a message with newlines) _showWarningTip prints an expected message 1`] = ` Array [ "[warning] [yellow]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", - "[warning] ", "[warning] [yellow]|[default]", - "[warning] ", "[warning] [yellow]| [default]This is a test", "[warning] [yellow]| [default]This is a test", "[warning] ", @@ -325,9 +289,7 @@ Array [ exports[`CustomTipsConfiguration formatting (a short message) _showErrorTip prints an expected message 1`] = ` Array [ "[error] [red]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", - "[error] ", "[error] [red]|[default]", - "[error] ", "[error] [red]| [default]This is a test", "[error] ", "[log] ", @@ -338,22 +300,17 @@ Array [ exports[`CustomTipsConfiguration formatting (a short message) _showInfoTip prints an expected message 1`] = ` Array [ "[log] | Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)", - "[log] ", "[log] |", - "[log] ", "[log] | This is a test", "[log] ", "[log] ", - "[log] ", ] `; exports[`CustomTipsConfiguration formatting (a short message) _showTip prints an expected message 1`] = ` Array [ "[error] [red]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", - "[error] ", "[error] [red]|[default]", - "[error] ", "[error] [red]| [default]This is a test", "[error] ", "[log] ", @@ -364,9 +321,7 @@ Array [ exports[`CustomTipsConfiguration formatting (a short message) _showWarningTip prints an expected message 1`] = ` Array [ "[warning] [yellow]| Custom Tip (TIP_PNPM_INVALID_NODE_VERSION)[default]", - "[warning] ", "[warning] [yellow]|[default]", - "[warning] ", "[warning] [yellow]| [default]This is a test", "[warning] ", "[log] ", diff --git a/libraries/rush-lib/src/api/test/__snapshots__/RushProjectConfiguration.test.ts.snap b/libraries/rush-lib/src/api/test/__snapshots__/RushProjectConfiguration.test.ts.snap index 987a503a40..aace898034 100644 --- a/libraries/rush-lib/src/api/test/__snapshots__/RushProjectConfiguration.test.ts.snap +++ b/libraries/rush-lib/src/api/test/__snapshots__/RushProjectConfiguration.test.ts.snap @@ -32,7 +32,7 @@ Map { exports[`RushProjectConfiguration operationSettingsByOperationName does not allow one outputFolderName to be under another 1`] = ` Array [ - "[ error] The project \\"test-project-d\\" has a \\"config/rush-project.json\\" configuration that defines two operations in the same command whose \\"outputFolderNames\\" would overlap. Operations outputs in the same command must be disjoint so that they can be independently cached. The \\"a/b\\" path overlaps between these operations: \\"_phase:b\\", \\"_phase:a\\"[n]", + "[ error] The project \\"test-project-d\\" has a \\"config/rush-project.json\\" configuration that defines two operations in the same command whose \\"outputFolderNames\\" would overlap. Operations outputs in the same command must be disjoint so that they can be independently cached. The \\"a/b\\" path overlaps between these operations: \\"_phase:b\\", \\"_phase:a\\"", ] `; @@ -60,18 +60,18 @@ exports[`RushProjectConfiguration operationSettingsByOperationName throws an err exports[`RushProjectConfiguration operationSettingsByOperationName validates mix of existent and nonexistent parameters 1`] = ` Array [ - "[ error] The project \\"test-project-g\\" has a \\"config/rush-project.json\\" configuration that specifies invalid parameter(s) in \\"parameterNamesToIgnore\\" for operation \\"_phase:build\\": --nonexistent-param. Valid parameters for this operation are: --production, --verbose.[n]", + "[ error] The project \\"test-project-g\\" has a \\"config/rush-project.json\\" configuration that specifies invalid parameter(s) in \\"parameterNamesToIgnore\\" for operation \\"_phase:build\\": --nonexistent-param. Valid parameters for this operation are: --production, --verbose.", ] `; exports[`RushProjectConfiguration operationSettingsByOperationName validates nonexistent parameters when operation has valid parameters 1`] = ` Array [ - "[ error] The project \\"test-project-f\\" has a \\"config/rush-project.json\\" configuration that specifies invalid parameter(s) in \\"parameterNamesToIgnore\\" for operation \\"_phase:build\\": --nonexistent-param, --another-nonexistent. Valid parameters for this operation are: --production, --verbose.[n]", + "[ error] The project \\"test-project-f\\" has a \\"config/rush-project.json\\" configuration that specifies invalid parameter(s) in \\"parameterNamesToIgnore\\" for operation \\"_phase:build\\": --nonexistent-param, --another-nonexistent. Valid parameters for this operation are: --production, --verbose.", ] `; exports[`RushProjectConfiguration operationSettingsByOperationName validates that parameters in parameterNamesToIgnore exist for the operation 1`] = ` Array [ - "[ error] The project \\"test-project-e\\" has a \\"config/rush-project.json\\" configuration that specifies invalid parameter(s) in \\"parameterNamesToIgnore\\" for operation \\"_phase:build\\": --invalid-parameter, --another-invalid, -malformed-parameter. Valid parameters for this operation are: (none).[n]", + "[ error] The project \\"test-project-e\\" has a \\"config/rush-project.json\\" configuration that specifies invalid parameter(s) in \\"parameterNamesToIgnore\\" for operation \\"_phase:build\\": --invalid-parameter, --another-invalid, -malformed-parameter. Valid parameters for this operation are: (none).", ] `; diff --git a/libraries/rush-lib/src/logic/operations/test/BuildPlanPlugin.test.ts b/libraries/rush-lib/src/logic/operations/test/BuildPlanPlugin.test.ts index 0af8c9c772..c5ce91c6fd 100644 --- a/libraries/rush-lib/src/logic/operations/test/BuildPlanPlugin.test.ts +++ b/libraries/rush-lib/src/logic/operations/test/BuildPlanPlugin.test.ts @@ -141,7 +141,7 @@ describe(BuildPlanPlugin.name, () => { expect( stringBufferTerminalProvider.getAllOutputAsChunks({ normalizeSpecialCharacters: false, - asFlat: true + asLines: true }) ).toMatchSnapshot(); }); diff --git a/libraries/rush-lib/src/logic/operations/test/OperationMetadataManager.test.ts b/libraries/rush-lib/src/logic/operations/test/OperationMetadataManager.test.ts index a6ac995171..6443e873d6 100644 --- a/libraries/rush-lib/src/logic/operations/test/OperationMetadataManager.test.ts +++ b/libraries/rush-lib/src/logic/operations/test/OperationMetadataManager.test.ts @@ -63,7 +63,7 @@ describe(OperationMetadataManager.name, () => { errorLogPath: '/path/to/errorLog' }); - expect(mockTerminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot(); + expect(mockTerminalProvider.getAllOutputAsChunks({ asLines: true })).toMatchSnapshot(); expect(mockTerminalProvider.getWarningOutput()).toBeFalsy(); }); @@ -87,7 +87,7 @@ describe(OperationMetadataManager.name, () => { errorLogPath: '/path/to/errorLog' }); - expect(mockTerminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot(); + expect(mockTerminalProvider.getAllOutputAsChunks({ asLines: true })).toMatchSnapshot(); }); it('should restore mixed chunked output', async () => { @@ -109,7 +109,7 @@ describe(OperationMetadataManager.name, () => { terminalProvider: mockTerminalProvider, errorLogPath: '/path/to/errorLog' }); - expect(mockTerminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot(); + expect(mockTerminalProvider.getAllOutputAsChunks({ asLines: true })).toMatchSnapshot(); }); it("should fallback to the log file when chunked output isn't available", async () => { diff --git a/libraries/rush-lib/src/logic/operations/test/__snapshots__/BuildPlanPlugin.test.ts.snap b/libraries/rush-lib/src/logic/operations/test/__snapshots__/BuildPlanPlugin.test.ts.snap index c1315986b0..619360abed 100644 --- a/libraries/rush-lib/src/logic/operations/test/__snapshots__/BuildPlanPlugin.test.ts.snap +++ b/libraries/rush-lib/src/logic/operations/test/__snapshots__/BuildPlanPlugin.test.ts.snap @@ -2,589 +2,325 @@ exports[`BuildPlanPlugin build plan debugging should generate a build plan 1`] = ` Array [ - "[ log] Build Plan Depth (deepest dependency tree): 5 -", - "[ log] Build Plan Width (maximum parallelism): 38 -", - "[ log] Number of Nodes per Depth: 22, 38, 33, 11, 1 -", - "[ log] Plan @ Depth 0 has 22 nodes and 0 dependents: -", - "[ log] - a (no-deps) -", - "[ log] - b (no-deps) -", - "[ log] - c (no-deps) -", - "[ log] - d (no-deps) -", - "[ log] - e (no-deps) -", - "[ log] - f (no-deps) -", - "[ log] - g (no-deps) -", - "[ log] - h (no-deps) -", - "[ log] - a (upstream-1) -", - "[ log] - a (upstream-2) -", - "[ log] - a (upstream-1-self-upstream) -", - "[ log] - i (no-deps) -", - "[ log] - j (no-deps) -", - "[ log] - i (upstream-1) -", - "[ log] - j (upstream-1) -", - "[ log] - i (upstream-2) -", - "[ log] - j (upstream-2) -", - "[ log] - a (upstream-3) -", - "[ log] - i (upstream-3) -", - "[ log] - j (upstream-3) -", - "[ log] - i (upstream-1-self-upstream) -", - "[ log] - j (upstream-1-self-upstream) -", - "[ log] Plan @ Depth 1 has 38 nodes and 22 dependents: -", - "[ log] - a (upstream-self) -", - "[ log] - b (upstream-1) -", - "[ log] - f (upstream-1) -", - "[ log] - g (upstream-1) -", - "[ log] - h (upstream-1) -", - "[ log] - b (upstream-self) -", - "[ log] - c (upstream-1) -", - "[ log] - d (upstream-1) -", - "[ log] - c (upstream-self) -", - "[ log] - e (upstream-1) -", - "[ log] - d (upstream-self) -", - "[ log] - e (upstream-self) -", - "[ log] - f (upstream-self) -", - "[ log] - g (upstream-self) -", - "[ log] - h (upstream-self) -", - "[ log] - b (upstream-2) -", - "[ log] - f (upstream-2) -", - "[ log] - g (upstream-2) -", - "[ log] - h (upstream-2) -", - "[ log] - a (upstream-1-self) -", - "[ log] - b (upstream-3) -", - "[ log] - f (upstream-3) -", - "[ log] - g (upstream-3) -", - "[ log] - h (upstream-3) -", - "[ log] - a (upstream-2-self) -", - "[ log] - b (complex) -", - "[ log] - f (complex) -", - "[ log] - g (complex) -", - "[ log] - h (complex) -", - "[ log] - i (upstream-self) -", - "[ log] - j (upstream-self) -", - "[ log] - i (upstream-1-self) -", - "[ log] - j (upstream-1-self) -", - "[ log] - i (upstream-2-self) -", - "[ log] - j (upstream-2-self) -", - "[ log] - a (complex) -", - "[ log] - i (complex) -", - "[ log] - j (complex) -", - "[ log] Plan @ Depth 2 has 33 nodes and 60 dependents: -", - "[ log] - b (upstream-self) -", - "[ log] - f (upstream-self) -", - "[ log] - h (upstream-self) -", - "[ log] - g (upstream-self) -", - "[ log] - c (upstream-2) -", - "[ log] - d (upstream-2) -", - "[ log] - b (upstream-1-self) -", - "[ log] - f (upstream-1-self) -", - "[ log] - g (upstream-1-self) -", - "[ log] - f (upstream-2) -", - "[ log] - h (upstream-1-self) -", - "[ log] - c (upstream-self) -", - "[ log] - d (upstream-self) -", - "[ log] - e (upstream-2) -", - "[ log] - c (upstream-1-self) -", - "[ log] - d (upstream-1-self) -", - "[ log] - e (upstream-self) -", - "[ log] - e (upstream-1-self) -", - "[ log] - c (upstream-3) -", - "[ log] - d (upstream-3) -", - "[ log] - b (upstream-2-self) -", - "[ log] - f (upstream-2-self) -", - "[ log] - g (upstream-2-self) -", - "[ log] - f (upstream-3) -", - "[ log] - h (upstream-2-self) -", - "[ log] - b (upstream-1-self-upstream) -", - "[ log] - f (upstream-1-self-upstream) -", - "[ log] - g (upstream-1-self-upstream) -", - "[ log] - h (upstream-1-self-upstream) -", - "[ log] - b (complex) -", - "[ log] - f (complex) -", - "[ log] - g (complex) -", - "[ log] - h (complex) -", - "[ log] Plan @ Depth 3 has 11 nodes and 93 dependents: -", - "[ log] - e (upstream-3) -", - "[ log] - c (upstream-2-self) -", - "[ log] - d (upstream-2-self) -", - "[ log] - c (upstream-1-self-upstream) -", - "[ log] - d (upstream-1-self-upstream) -", - "[ log] - f (upstream-1-self-upstream) -", - "[ log] - e (upstream-2-self) -", - "[ log] - e (upstream-1-self-upstream) -", - "[ log] - c (complex) -", - "[ log] - d (complex) -", - "[ log] - f (complex) -", - "[ log] Plan @ Depth 4 has 1 nodes and 104 dependents: -", - "[ log] - e (complex) -", - "[ log] ################################################## -", - "[ log] a (no-deps): (0) -", - "[ log] b (no-deps): (0) -", - "[ log] c (no-deps): (0) -", - "[ log] d (no-deps): (0) -", - "[ log] e (no-deps): (0) -", - "[ log] f (no-deps): (0) -", - "[ log] g (no-deps): (0) -", - "[ log] h (no-deps): (0) -", - "[ log] a (upstream-1): (0) -", - "[ log] a (upstream-2): (0) -", - "[ log] a (upstream-1-self-upstream): (0) -", - "[ log] i (no-deps): (1) -", - "[ log] j (no-deps): (2) -", - "[ log] i (upstream-1): (3) -", - "[ log] j (upstream-1): (4) -", - "[ log] i (upstream-2): (5) -", - "[ log] j (upstream-2): (6) -", - "[ log] a (upstream-3): (7) -", - "[ log] i (upstream-3): (8) -", - "[ log] j (upstream-3): (9) -", - "[ log] i (upstream-1-self-upstream): (10) -", - "[ log] j (upstream-1-self-upstream): (11) -", - "[ log] a (upstream-self): -(0) -", - "[ log] b (upstream-1): -(0) -", - "[ log] c (upstream-1): -(0) -", - "[ log] d (upstream-1): -(0) -", - "[ log] e (upstream-1): -(0) -", - "[ log] f (upstream-1): -(0) -", - "[ log] g (upstream-1): -(0) -", - "[ log] h (upstream-1): -(0) -", - "[ log] b (upstream-2): -(0) -", - "[ log] g (upstream-2): -(0) -", - "[ log] h (upstream-2): -(0) -", - "[ log] b (upstream-3): -(0) -", - "[ log] g (upstream-3): -(0) -", - "[ log] h (upstream-3): -(0) -", - "[ log] a (upstream-1-self): -(0) -", - "[ log] a (upstream-2-self): -(0) -", - "[ log] i (upstream-self): -(1) -", - "[ log] j (upstream-self): -(2) -", - "[ log] i (upstream-1-self): -(3) -", - "[ log] j (upstream-1-self): -(4) -", - "[ log] i (upstream-2-self): -(5) -", - "[ log] j (upstream-2-self): -(6) -", - "[ log] a (complex): -(7) -", - "[ log] i (complex): -(8) -", - "[ log] j (complex): -(9) -", - "[ log] b (upstream-self): --(0) -", - "[ log] f (upstream-self): --(0) -", - "[ log] h (upstream-self): --(0) -", - "[ log] g (upstream-self): --(0) -", - "[ log] c (upstream-2): --(0) -", - "[ log] d (upstream-2): --(0) -", - "[ log] e (upstream-2): --(0) -", - "[ log] f (upstream-2): --(0) -", - "[ log] c (upstream-3): --(0) -", - "[ log] d (upstream-3): --(0) -", - "[ log] f (upstream-3): --(0) -", - "[ log] b (upstream-1-self): --(0) -", - "[ log] c (upstream-1-self): --(0) -", - "[ log] d (upstream-1-self): --(0) -", - "[ log] e (upstream-1-self): --(0) -", - "[ log] f (upstream-1-self): --(0) -", - "[ log] g (upstream-1-self): --(0) -", - "[ log] h (upstream-1-self): --(0) -", - "[ log] b (upstream-2-self): --(0) -", - "[ log] g (upstream-2-self): --(0) -", - "[ log] h (upstream-2-self): --(0) -", - "[ log] b (upstream-1-self-upstream): --(0) -", - "[ log] g (upstream-1-self-upstream): --(0) -", - "[ log] h (upstream-1-self-upstream): --(0) -", - "[ log] b (complex): --(0) -", - "[ log] g (complex): --(0) -", - "[ log] h (complex): --(0) -", - "[ log] c (upstream-self): ---(0) -", - "[ log] d (upstream-self): ---(0) -", - "[ log] e (upstream-3): ---(0) -", - "[ log] c (upstream-2-self): ---(0) -", - "[ log] d (upstream-2-self): ---(0) -", - "[ log] e (upstream-2-self): ---(0) -", - "[ log] f (upstream-2-self): ---(0) -", - "[ log] c (upstream-1-self-upstream): ---(0) -", - "[ log] d (upstream-1-self-upstream): ---(0) -", - "[ log] e (upstream-1-self-upstream): ---(0) -", - "[ log] f (upstream-1-self-upstream): ---(0) -", - "[ log] c (complex): ---(0) -", - "[ log] d (complex): ---(0) -", - "[ log] f (complex): ---(0) -", - "[ log] e (upstream-self): ----(0) -", - "[ log] e (complex): ----(0) -", - "[ log] ################################################## -", - "[ log] Cluster 0: -", - "[ log] - Dependencies: none -", - "[ log] - Clustered by: - - (a (no-deps)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (b (no-deps)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (a (upstream-self)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (c (no-deps)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (b (upstream-self)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (d (no-deps)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (e (no-deps)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (c (upstream-self)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (f (no-deps)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (h (upstream-self)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (h (no-deps)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (g (no-deps)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (a (upstream-1)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (b (upstream-1)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (c (upstream-1)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (h (upstream-1)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (a (upstream-2)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (b (upstream-2)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (c (upstream-2)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (h (upstream-2)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (d (upstream-1)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (e (upstream-1)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (f (upstream-1)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (g (upstream-1)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (d (upstream-2)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (e (upstream-2)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (f (upstream-2)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (g (upstream-2)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (a (upstream-1-self)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (b (upstream-1-self)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (c (upstream-1-self)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (h (upstream-1-self)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (b (upstream-3)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (a (upstream-1-self-upstream)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (a (upstream-2-self)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (c (upstream-3)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (b (upstream-1-self-upstream)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (b (upstream-2-self)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (d (upstream-3)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (e (upstream-3)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (c (upstream-1-self-upstream)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (c (upstream-2-self)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (f (upstream-3)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (h (upstream-1-self-upstream)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (h (upstream-2-self)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (g (upstream-3)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" - - (h (upstream-3)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" -", - "[ log] - Operations: a (no-deps), b (no-deps), c (no-deps), d (no-deps), e (no-deps), f (no-deps), g (no-deps), h (no-deps), a (upstream-self), b (upstream-self), c (upstream-self), d (upstream-self), e (upstream-self), f (upstream-self), h (upstream-self), g (upstream-self), a (upstream-1), b (upstream-1), c (upstream-1), d (upstream-1), e (upstream-1), f (upstream-1), g (upstream-1), h (upstream-1), a (upstream-2), b (upstream-2), c (upstream-2), d (upstream-2), e (upstream-2), f (upstream-2), g (upstream-2), h (upstream-2), b (upstream-3), c (upstream-3), d (upstream-3), e (upstream-3), f (upstream-3), g (upstream-3), h (upstream-3), a (upstream-1-self), b (upstream-1-self), c (upstream-1-self), d (upstream-1-self), e (upstream-1-self), f (upstream-1-self), g (upstream-1-self), h (upstream-1-self), a (upstream-2-self), b (upstream-2-self), c (upstream-2-self), d (upstream-2-self), e (upstream-2-self), f (upstream-2-self), g (upstream-2-self), h (upstream-2-self), a (upstream-1-self-upstream), b (upstream-1-self-upstream), c (upstream-1-self-upstream), d (upstream-1-self-upstream), e (upstream-1-self-upstream), f (upstream-1-self-upstream), g (upstream-1-self-upstream), h (upstream-1-self-upstream), b (complex), c (complex), d (complex), e (complex), f (complex), g (complex), h (complex) -", - "[ log] -------------------------------------------------- -", - "[ log] Cluster 1: -", - "[ log] - Dependencies: none -", - "[ log] - Clustered by: - - (i (no-deps)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" -", - "[ log] - Operations: i (no-deps), i (upstream-self) -", - "[ log] -------------------------------------------------- -", - "[ log] Cluster 2: -", - "[ log] - Dependencies: none -", - "[ log] - Clustered by: - - (j (no-deps)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" -", - "[ log] - Operations: j (no-deps), j (upstream-self) -", - "[ log] -------------------------------------------------- -", - "[ log] Cluster 3: -", - "[ log] - Dependencies: none -", - "[ log] - Clustered by: - - (i (upstream-1)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" -", - "[ log] - Operations: i (upstream-1), i (upstream-1-self) -", - "[ log] -------------------------------------------------- -", - "[ log] Cluster 4: -", - "[ log] - Dependencies: none -", - "[ log] - Clustered by: - - (j (upstream-1)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" -", - "[ log] - Operations: j (upstream-1), j (upstream-1-self) -", - "[ log] -------------------------------------------------- -", - "[ log] Cluster 5: -", - "[ log] - Dependencies: none -", - "[ log] - Clustered by: - - (i (upstream-2)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" -", - "[ log] - Operations: i (upstream-2), i (upstream-2-self) -", - "[ log] -------------------------------------------------- -", - "[ log] Cluster 6: -", - "[ log] - Dependencies: none -", - "[ log] - Clustered by: - - (j (upstream-2)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" -", - "[ log] - Operations: j (upstream-2), j (upstream-2-self) -", - "[ log] -------------------------------------------------- -", - "[ log] Cluster 7: -", - "[ log] - Dependencies: none -", - "[ log] - Clustered by: - - (a (upstream-3)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" -", - "[ log] - Operations: a (upstream-3), a (complex) -", - "[ log] -------------------------------------------------- -", - "[ log] Cluster 8: -", - "[ log] - Dependencies: none -", - "[ log] - Clustered by: - - (i (upstream-3)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" -", - "[ log] - Operations: i (upstream-3), i (complex) -", - "[ log] -------------------------------------------------- -", - "[ log] Cluster 9: -", - "[ log] - Dependencies: none -", - "[ log] - Clustered by: - - (j (upstream-3)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\" -", - "[ log] - Operations: j (upstream-3), j (complex) -", - "[ log] -------------------------------------------------- -", - "[ log] Cluster 10: -", - "[ log] - Dependencies: none -", - "[ log] - Operations: i (upstream-1-self-upstream) -", - "[ log] -------------------------------------------------- -", - "[ log] Cluster 11: -", - "[ log] - Dependencies: none -", - "[ log] - Operations: j (upstream-1-self-upstream) -", - "[ log] -------------------------------------------------- -", - "[ log] ################################################## -", + "[ log] Build Plan Depth (deepest dependency tree): 5", + "[ log] Build Plan Width (maximum parallelism): 38", + "[ log] Number of Nodes per Depth: 22, 38, 33, 11, 1", + "[ log] Plan @ Depth 0 has 22 nodes and 0 dependents:", + "[ log] - a (no-deps)", + "[ log] - b (no-deps)", + "[ log] - c (no-deps)", + "[ log] - d (no-deps)", + "[ log] - e (no-deps)", + "[ log] - f (no-deps)", + "[ log] - g (no-deps)", + "[ log] - h (no-deps)", + "[ log] - a (upstream-1)", + "[ log] - a (upstream-2)", + "[ log] - a (upstream-1-self-upstream)", + "[ log] - i (no-deps)", + "[ log] - j (no-deps)", + "[ log] - i (upstream-1)", + "[ log] - j (upstream-1)", + "[ log] - i (upstream-2)", + "[ log] - j (upstream-2)", + "[ log] - a (upstream-3)", + "[ log] - i (upstream-3)", + "[ log] - j (upstream-3)", + "[ log] - i (upstream-1-self-upstream)", + "[ log] - j (upstream-1-self-upstream)", + "[ log] Plan @ Depth 1 has 38 nodes and 22 dependents:", + "[ log] - a (upstream-self)", + "[ log] - b (upstream-1)", + "[ log] - f (upstream-1)", + "[ log] - g (upstream-1)", + "[ log] - h (upstream-1)", + "[ log] - b (upstream-self)", + "[ log] - c (upstream-1)", + "[ log] - d (upstream-1)", + "[ log] - c (upstream-self)", + "[ log] - e (upstream-1)", + "[ log] - d (upstream-self)", + "[ log] - e (upstream-self)", + "[ log] - f (upstream-self)", + "[ log] - g (upstream-self)", + "[ log] - h (upstream-self)", + "[ log] - b (upstream-2)", + "[ log] - f (upstream-2)", + "[ log] - g (upstream-2)", + "[ log] - h (upstream-2)", + "[ log] - a (upstream-1-self)", + "[ log] - b (upstream-3)", + "[ log] - f (upstream-3)", + "[ log] - g (upstream-3)", + "[ log] - h (upstream-3)", + "[ log] - a (upstream-2-self)", + "[ log] - b (complex)", + "[ log] - f (complex)", + "[ log] - g (complex)", + "[ log] - h (complex)", + "[ log] - i (upstream-self)", + "[ log] - j (upstream-self)", + "[ log] - i (upstream-1-self)", + "[ log] - j (upstream-1-self)", + "[ log] - i (upstream-2-self)", + "[ log] - j (upstream-2-self)", + "[ log] - a (complex)", + "[ log] - i (complex)", + "[ log] - j (complex)", + "[ log] Plan @ Depth 2 has 33 nodes and 60 dependents:", + "[ log] - b (upstream-self)", + "[ log] - f (upstream-self)", + "[ log] - h (upstream-self)", + "[ log] - g (upstream-self)", + "[ log] - c (upstream-2)", + "[ log] - d (upstream-2)", + "[ log] - b (upstream-1-self)", + "[ log] - f (upstream-1-self)", + "[ log] - g (upstream-1-self)", + "[ log] - f (upstream-2)", + "[ log] - h (upstream-1-self)", + "[ log] - c (upstream-self)", + "[ log] - d (upstream-self)", + "[ log] - e (upstream-2)", + "[ log] - c (upstream-1-self)", + "[ log] - d (upstream-1-self)", + "[ log] - e (upstream-self)", + "[ log] - e (upstream-1-self)", + "[ log] - c (upstream-3)", + "[ log] - d (upstream-3)", + "[ log] - b (upstream-2-self)", + "[ log] - f (upstream-2-self)", + "[ log] - g (upstream-2-self)", + "[ log] - f (upstream-3)", + "[ log] - h (upstream-2-self)", + "[ log] - b (upstream-1-self-upstream)", + "[ log] - f (upstream-1-self-upstream)", + "[ log] - g (upstream-1-self-upstream)", + "[ log] - h (upstream-1-self-upstream)", + "[ log] - b (complex)", + "[ log] - f (complex)", + "[ log] - g (complex)", + "[ log] - h (complex)", + "[ log] Plan @ Depth 3 has 11 nodes and 93 dependents:", + "[ log] - e (upstream-3)", + "[ log] - c (upstream-2-self)", + "[ log] - d (upstream-2-self)", + "[ log] - c (upstream-1-self-upstream)", + "[ log] - d (upstream-1-self-upstream)", + "[ log] - f (upstream-1-self-upstream)", + "[ log] - e (upstream-2-self)", + "[ log] - e (upstream-1-self-upstream)", + "[ log] - c (complex)", + "[ log] - d (complex)", + "[ log] - f (complex)", + "[ log] Plan @ Depth 4 has 1 nodes and 104 dependents:", + "[ log] - e (complex)", + "[ log] ##################################################", + "[ log] a (no-deps): (0)", + "[ log] b (no-deps): (0)", + "[ log] c (no-deps): (0)", + "[ log] d (no-deps): (0)", + "[ log] e (no-deps): (0)", + "[ log] f (no-deps): (0)", + "[ log] g (no-deps): (0)", + "[ log] h (no-deps): (0)", + "[ log] a (upstream-1): (0)", + "[ log] a (upstream-2): (0)", + "[ log] a (upstream-1-self-upstream): (0)", + "[ log] i (no-deps): (1)", + "[ log] j (no-deps): (2)", + "[ log] i (upstream-1): (3)", + "[ log] j (upstream-1): (4)", + "[ log] i (upstream-2): (5)", + "[ log] j (upstream-2): (6)", + "[ log] a (upstream-3): (7)", + "[ log] i (upstream-3): (8)", + "[ log] j (upstream-3): (9)", + "[ log] i (upstream-1-self-upstream): (10)", + "[ log] j (upstream-1-self-upstream): (11)", + "[ log] a (upstream-self): -(0)", + "[ log] b (upstream-1): -(0)", + "[ log] c (upstream-1): -(0)", + "[ log] d (upstream-1): -(0)", + "[ log] e (upstream-1): -(0)", + "[ log] f (upstream-1): -(0)", + "[ log] g (upstream-1): -(0)", + "[ log] h (upstream-1): -(0)", + "[ log] b (upstream-2): -(0)", + "[ log] g (upstream-2): -(0)", + "[ log] h (upstream-2): -(0)", + "[ log] b (upstream-3): -(0)", + "[ log] g (upstream-3): -(0)", + "[ log] h (upstream-3): -(0)", + "[ log] a (upstream-1-self): -(0)", + "[ log] a (upstream-2-self): -(0)", + "[ log] i (upstream-self): -(1)", + "[ log] j (upstream-self): -(2)", + "[ log] i (upstream-1-self): -(3)", + "[ log] j (upstream-1-self): -(4)", + "[ log] i (upstream-2-self): -(5)", + "[ log] j (upstream-2-self): -(6)", + "[ log] a (complex): -(7)", + "[ log] i (complex): -(8)", + "[ log] j (complex): -(9)", + "[ log] b (upstream-self): --(0)", + "[ log] f (upstream-self): --(0)", + "[ log] h (upstream-self): --(0)", + "[ log] g (upstream-self): --(0)", + "[ log] c (upstream-2): --(0)", + "[ log] d (upstream-2): --(0)", + "[ log] e (upstream-2): --(0)", + "[ log] f (upstream-2): --(0)", + "[ log] c (upstream-3): --(0)", + "[ log] d (upstream-3): --(0)", + "[ log] f (upstream-3): --(0)", + "[ log] b (upstream-1-self): --(0)", + "[ log] c (upstream-1-self): --(0)", + "[ log] d (upstream-1-self): --(0)", + "[ log] e (upstream-1-self): --(0)", + "[ log] f (upstream-1-self): --(0)", + "[ log] g (upstream-1-self): --(0)", + "[ log] h (upstream-1-self): --(0)", + "[ log] b (upstream-2-self): --(0)", + "[ log] g (upstream-2-self): --(0)", + "[ log] h (upstream-2-self): --(0)", + "[ log] b (upstream-1-self-upstream): --(0)", + "[ log] g (upstream-1-self-upstream): --(0)", + "[ log] h (upstream-1-self-upstream): --(0)", + "[ log] b (complex): --(0)", + "[ log] g (complex): --(0)", + "[ log] h (complex): --(0)", + "[ log] c (upstream-self): ---(0)", + "[ log] d (upstream-self): ---(0)", + "[ log] e (upstream-3): ---(0)", + "[ log] c (upstream-2-self): ---(0)", + "[ log] d (upstream-2-self): ---(0)", + "[ log] e (upstream-2-self): ---(0)", + "[ log] f (upstream-2-self): ---(0)", + "[ log] c (upstream-1-self-upstream): ---(0)", + "[ log] d (upstream-1-self-upstream): ---(0)", + "[ log] e (upstream-1-self-upstream): ---(0)", + "[ log] f (upstream-1-self-upstream): ---(0)", + "[ log] c (complex): ---(0)", + "[ log] d (complex): ---(0)", + "[ log] f (complex): ---(0)", + "[ log] e (upstream-self): ----(0)", + "[ log] e (complex): ----(0)", + "[ log] ##################################################", + "[ log] Cluster 0:", + "[ log] - Dependencies: none", + "[ log] - Clustered by: ", + "[ log] - (a (no-deps)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (b (no-deps)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (a (upstream-self)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (c (no-deps)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (b (upstream-self)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (d (no-deps)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (e (no-deps)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (c (upstream-self)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (f (no-deps)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (h (upstream-self)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (h (no-deps)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (g (no-deps)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (a (upstream-1)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (b (upstream-1)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (c (upstream-1)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (h (upstream-1)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (a (upstream-2)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (b (upstream-2)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (c (upstream-2)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (h (upstream-2)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (d (upstream-1)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (e (upstream-1)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (f (upstream-1)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (g (upstream-1)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (d (upstream-2)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (e (upstream-2)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (f (upstream-2)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (g (upstream-2)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (a (upstream-1-self)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (b (upstream-1-self)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (c (upstream-1-self)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (h (upstream-1-self)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (b (upstream-3)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (a (upstream-1-self-upstream)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (a (upstream-2-self)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (c (upstream-3)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (b (upstream-1-self-upstream)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (b (upstream-2-self)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (d (upstream-3)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (e (upstream-3)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (c (upstream-1-self-upstream)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (c (upstream-2-self)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (f (upstream-3)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (h (upstream-1-self-upstream)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (h (upstream-2-self)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (g (upstream-3)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - (h (upstream-3)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - Operations: a (no-deps), b (no-deps), c (no-deps), d (no-deps), e (no-deps), f (no-deps), g (no-deps), h (no-deps), a (upstream-self), b (upstream-self), c (upstream-self), d (upstream-self), e (upstream-self), f (upstream-self), h (upstream-self), g (upstream-self), a (upstream-1), b (upstream-1), c (upstream-1), d (upstream-1), e (upstream-1), f (upstream-1), g (upstream-1), h (upstream-1), a (upstream-2), b (upstream-2), c (upstream-2), d (upstream-2), e (upstream-2), f (upstream-2), g (upstream-2), h (upstream-2), b (upstream-3), c (upstream-3), d (upstream-3), e (upstream-3), f (upstream-3), g (upstream-3), h (upstream-3), a (upstream-1-self), b (upstream-1-self), c (upstream-1-self), d (upstream-1-self), e (upstream-1-self), f (upstream-1-self), g (upstream-1-self), h (upstream-1-self), a (upstream-2-self), b (upstream-2-self), c (upstream-2-self), d (upstream-2-self), e (upstream-2-self), f (upstream-2-self), g (upstream-2-self), h (upstream-2-self), a (upstream-1-self-upstream), b (upstream-1-self-upstream), c (upstream-1-self-upstream), d (upstream-1-self-upstream), e (upstream-1-self-upstream), f (upstream-1-self-upstream), g (upstream-1-self-upstream), h (upstream-1-self-upstream), b (complex), c (complex), d (complex), e (complex), f (complex), g (complex), h (complex)", + "[ log] --------------------------------------------------", + "[ log] Cluster 1:", + "[ log] - Dependencies: none", + "[ log] - Clustered by: ", + "[ log] - (i (no-deps)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - Operations: i (no-deps), i (upstream-self)", + "[ log] --------------------------------------------------", + "[ log] Cluster 2:", + "[ log] - Dependencies: none", + "[ log] - Clustered by: ", + "[ log] - (j (no-deps)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - Operations: j (no-deps), j (upstream-self)", + "[ log] --------------------------------------------------", + "[ log] Cluster 3:", + "[ log] - Dependencies: none", + "[ log] - Clustered by: ", + "[ log] - (i (upstream-1)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - Operations: i (upstream-1), i (upstream-1-self)", + "[ log] --------------------------------------------------", + "[ log] Cluster 4:", + "[ log] - Dependencies: none", + "[ log] - Clustered by: ", + "[ log] - (j (upstream-1)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - Operations: j (upstream-1), j (upstream-1-self)", + "[ log] --------------------------------------------------", + "[ log] Cluster 5:", + "[ log] - Dependencies: none", + "[ log] - Clustered by: ", + "[ log] - (i (upstream-2)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - Operations: i (upstream-2), i (upstream-2-self)", + "[ log] --------------------------------------------------", + "[ log] Cluster 6:", + "[ log] - Dependencies: none", + "[ log] - Clustered by: ", + "[ log] - (j (upstream-2)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - Operations: j (upstream-2), j (upstream-2-self)", + "[ log] --------------------------------------------------", + "[ log] Cluster 7:", + "[ log] - Dependencies: none", + "[ log] - Clustered by: ", + "[ log] - (a (upstream-3)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - Operations: a (upstream-3), a (complex)", + "[ log] --------------------------------------------------", + "[ log] Cluster 8:", + "[ log] - Dependencies: none", + "[ log] - Clustered by: ", + "[ log] - (i (upstream-3)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - Operations: i (upstream-3), i (complex)", + "[ log] --------------------------------------------------", + "[ log] Cluster 9:", + "[ log] - Dependencies: none", + "[ log] - Clustered by: ", + "[ log] - (j (upstream-3)) \\"Project does not have a rush-project.json configuration file, or one provided by a rig, so it does not support caching.\\"", + "[ log] - Operations: j (upstream-3), j (complex)", + "[ log] --------------------------------------------------", + "[ log] Cluster 10:", + "[ log] - Dependencies: none", + "[ log] - Operations: i (upstream-1-self-upstream)", + "[ log] --------------------------------------------------", + "[ log] Cluster 11:", + "[ log] - Dependencies: none", + "[ log] - Operations: j (upstream-1-self-upstream)", + "[ log] --------------------------------------------------", + "[ log] ##################################################", ] `; diff --git a/libraries/rush-lib/src/logic/operations/test/__snapshots__/OperationMetadataManager.test.ts.snap b/libraries/rush-lib/src/logic/operations/test/__snapshots__/OperationMetadataManager.test.ts.snap index 01ae0ceb12..d3fd74b75d 100644 --- a/libraries/rush-lib/src/logic/operations/test/__snapshots__/OperationMetadataManager.test.ts.snap +++ b/libraries/rush-lib/src/logic/operations/test/__snapshots__/OperationMetadataManager.test.ts.snap @@ -11,21 +11,21 @@ Array [ exports[`OperationMetadataManager should restore chunked stderr 1`] = ` Array [ - "[ error] chunk1[n]", - "[ error] chunk2[n]", + "[ error] chunk1", + "[ error] chunk2", ] `; exports[`OperationMetadataManager should restore chunked stdout 1`] = ` Array [ - "[ log] chunk1[n]", - "[ log] chunk2[n]", + "[ log] chunk1", + "[ log] chunk2", ] `; exports[`OperationMetadataManager should restore mixed chunked output 1`] = ` Array [ - "[ log] logged to stdout[n]", - "[ error] logged to stderr[n]", + "[ log] logged to stdout", + "[ error] logged to stderr", ] `; diff --git a/libraries/rush-lib/src/logic/pnpm/test/PnpmShrinkwrapFile.test.ts b/libraries/rush-lib/src/logic/pnpm/test/PnpmShrinkwrapFile.test.ts index 82b5a6012d..b0a090ed9f 100644 --- a/libraries/rush-lib/src/logic/pnpm/test/PnpmShrinkwrapFile.test.ts +++ b/libraries/rush-lib/src/logic/pnpm/test/PnpmShrinkwrapFile.test.ts @@ -546,7 +546,7 @@ snapshots: terminal ) ).toThrowError(AlreadyReportedError); - expect(terminalProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot(); + expect(terminalProvider.getAllOutputAsChunks({ asLines: true })).toMatchSnapshot(); }); }); }); diff --git a/libraries/rush-lib/src/logic/pnpm/test/__snapshots__/PnpmShrinkwrapFile.test.ts.snap b/libraries/rush-lib/src/logic/pnpm/test/__snapshots__/PnpmShrinkwrapFile.test.ts.snap index 1872e08ff2..3d7e356ebc 100644 --- a/libraries/rush-lib/src/logic/pnpm/test/__snapshots__/PnpmShrinkwrapFile.test.ts.snap +++ b/libraries/rush-lib/src/logic/pnpm/test/__snapshots__/PnpmShrinkwrapFile.test.ts.snap @@ -2,6 +2,7 @@ exports[`PnpmShrinkwrapFile Check is workspace project modified pnpm lockfile major version 9 sha1 integrity can be handled when disallowInsecureSha1 1`] = ` Array [ - "[ error] Error: An integrity field with \\"sha1\\" was detected in the pnpm-lock.yaml file located in subspace default; this conflicts with the \\"disallowInsecureSha1\\" policy from pnpm-config.json.[n][n]", + "[ error] Error: An integrity field with \\"sha1\\" was detected in the pnpm-lock.yaml file located in subspace default; this conflicts with the \\"disallowInsecureSha1\\" policy from pnpm-config.json.", + "[ error] ", ] `; diff --git a/libraries/rush-lib/src/logic/test/InstallHelpers.test.ts b/libraries/rush-lib/src/logic/test/InstallHelpers.test.ts index d427a9aec9..c6441d7484 100644 --- a/libraries/rush-lib/src/logic/test/InstallHelpers.test.ts +++ b/libraries/rush-lib/src/logic/test/InstallHelpers.test.ts @@ -28,7 +28,7 @@ describe('InstallHelpers', () => { expect( terminalProvider.getAllOutputAsChunks({ normalizeSpecialCharacters: true, - asFlat: true + asLines: true }) ).toMatchSnapshot('Terminal Output'); mockJsonFileSave.mockClear(); diff --git a/libraries/rush-lib/src/logic/test/ProjectImpactGraphGenerator.test.ts b/libraries/rush-lib/src/logic/test/ProjectImpactGraphGenerator.test.ts index 5261fe3096..583afbca64 100644 --- a/libraries/rush-lib/src/logic/test/ProjectImpactGraphGenerator.test.ts +++ b/libraries/rush-lib/src/logic/test/ProjectImpactGraphGenerator.test.ts @@ -25,7 +25,7 @@ async function runTestForExampleRepoAsync( expect( terminalProvider.getAllOutputAsChunks({ normalizeSpecialCharacters: true, - asFlat: true + asLines: true }) ).toMatchSnapshot('Terminal Output'); } diff --git a/libraries/rush-lib/src/logic/test/__snapshots__/ProjectImpactGraphGenerator.test.ts.snap b/libraries/rush-lib/src/logic/test/__snapshots__/ProjectImpactGraphGenerator.test.ts.snap index 3aaa6fe9db..fa265e9059 100644 --- a/libraries/rush-lib/src/logic/test/__snapshots__/ProjectImpactGraphGenerator.test.ts.snap +++ b/libraries/rush-lib/src/logic/test/__snapshots__/ProjectImpactGraphGenerator.test.ts.snap @@ -93,8 +93,8 @@ exports[`ProjectImpactGraphGenerator generateAsync Correctly generates a project exports[`ProjectImpactGraphGenerator generateAsync Correctly generates a project impact graph (repo: ""packages""): Terminal Output 1`] = ` Array [ - "[ log] [n]", - "[ log] [green]Generate project impact graph successfully. (1.50 seconds)[default][n]", + "[ log] ", + "[ log] [green]Generate project impact graph successfully. (1.50 seconds)[default]", ] `; @@ -167,8 +167,8 @@ exports[`ProjectImpactGraphGenerator generateAsync Correctly generates a project exports[`ProjectImpactGraphGenerator generateAsync Correctly generates a project impact graph (repo: ""repo""): Terminal Output 1`] = ` Array [ - "[ log] [n]", - "[ log] [green]Generate project impact graph successfully. (1.50 seconds)[default][n]", + "[ log] ", + "[ log] [green]Generate project impact graph successfully. (1.50 seconds)[default]", ] `; @@ -267,8 +267,8 @@ exports[`ProjectImpactGraphGenerator generateAsync Correctly generates a project exports[`ProjectImpactGraphGenerator generateAsync Correctly generates a project impact graph (repo: ""workspacePackages""): Terminal Output 1`] = ` Array [ - "[ log] [n]", - "[ log] [green]Generate project impact graph successfully. (1.50 seconds)[default][n]", + "[ log] ", + "[ log] [green]Generate project impact graph successfully. (1.50 seconds)[default]", ] `; diff --git a/libraries/terminal/src/StringBufferTerminalProvider.ts b/libraries/terminal/src/StringBufferTerminalProvider.ts index b5232543c4..20164aaa46 100644 --- a/libraries/terminal/src/StringBufferTerminalProvider.ts +++ b/libraries/terminal/src/StringBufferTerminalProvider.ts @@ -24,9 +24,9 @@ export interface IStringBufferOutputOptions { */ export interface IStringBufferOutputChunksOptions extends IStringBufferOutputOptions { /** - * If true, the output chunks will be returned as a flat array of prefixed strings of an array of objects. + * If true, the output will be returned as an array of lines prefixed with severity tokens. */ - asFlat?: boolean; + asLines?: boolean; } /** @@ -102,10 +102,19 @@ export class StringBufferTerminalProvider implements ITerminalProvider { * {@inheritDoc ITerminalProvider.write} */ public write(text: string, severity: TerminalProviderSeverity): void { - this._allOutputChunks.push({ - text, - severity: TerminalProviderSeverity[severity] as TerminalProviderSeverityName - }); + const severityName: TerminalProviderSeverityName = TerminalProviderSeverity[ + severity + ] as TerminalProviderSeverityName; + + const lastChunk: IOutputChunk | undefined = this._allOutputChunks[this._allOutputChunks.length - 1]; + if (lastChunk && lastChunk.severity === severityName) { + lastChunk.text += text; + } else { + this._allOutputChunks.push({ + text, + severity: severityName + }); + } switch (severity) { case TerminalProviderSeverity.warning: { @@ -228,21 +237,40 @@ export class StringBufferTerminalProvider implements ITerminalProvider { * Get everything that has been written as an array of output chunks, preserving order. */ public getAllOutputAsChunks( - options?: IStringBufferOutputChunksOptions & { asFlat?: false } + options?: IStringBufferOutputChunksOptions & { asLines?: false } ): IOutputChunk[]; public getAllOutputAsChunks( - options: IStringBufferOutputChunksOptions & { asFlat: true } + options: IStringBufferOutputChunksOptions & { asLines: true } ): `[${string}] ${string}`[]; public getAllOutputAsChunks(options: IStringBufferOutputChunksOptions = {}): IOutputChunk[] | string[] { - if (options.asFlat) { - return this._allOutputChunks.map(({ text: rawText, severity: rawSeverity }) => { - const text: string = _normalizeOutput(rawText, options); - const severity: TerminalProviderSeverity | string = ( - rawSeverity as TerminalProviderSeverityName - ).padStart(LONGEST_SEVERITY_NAME_LENGTH, ' '); + if (options.asLines) { + const lines: `[${string}] ${string}`[] = []; + + for (const { text: rawText, severity: rawSeverity } of this._allOutputChunks) { + const severity: string = (rawSeverity as TerminalProviderSeverityName).padStart( + LONGEST_SEVERITY_NAME_LENGTH, + ' ' + ); + + const lfText: string = Text.convertToLf(rawText); + const rawLines: string[] = lfText.split('\n'); + + // Emit one entry per logical line. + for (let i: number = 0; i < rawLines.length; i++) { + const isLast: boolean = i === rawLines.length - 1; + const isFinalTrailingEmpty: boolean = isLast && rawLines[i] === ''; + + if (isFinalTrailingEmpty) { + continue; + } + + const lineText: string = rawLines[i]; + const text: string = _normalizeOutput(lineText, options); + lines.push(`[${severity}] ${text}`); + } + } - return `[${severity}] ${text}`; - }); + return lines; } else { return this._allOutputChunks.map(({ text: rawText, severity }) => { const text: string = _normalizeOutput(rawText, options); diff --git a/libraries/terminal/src/test/PrefixProxyTerminalProvider.test.ts b/libraries/terminal/src/test/PrefixProxyTerminalProvider.test.ts index 12e2384d3c..fc22319940 100644 --- a/libraries/terminal/src/test/PrefixProxyTerminalProvider.test.ts +++ b/libraries/terminal/src/test/PrefixProxyTerminalProvider.test.ts @@ -14,7 +14,7 @@ function runTestsForTerminalProvider( function verifyProvider(): void { expect(baseProvider.getAllOutput(true)).toMatchSnapshot('output'); - expect(baseProvider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot('output as chunks'); + expect(baseProvider.getAllOutputAsChunks({ asLines: true })).toMatchSnapshot('output as chunks'); } beforeEach(() => { diff --git a/libraries/terminal/src/test/Terminal.test.ts b/libraries/terminal/src/test/Terminal.test.ts index 48f59cc112..ec211da3ef 100644 --- a/libraries/terminal/src/test/Terminal.test.ts +++ b/libraries/terminal/src/test/Terminal.test.ts @@ -11,7 +11,7 @@ describe(Terminal.name, () => { function verifyProvider(): void { expect(provider.getAllOutput()).toMatchSnapshot('output'); - expect(provider.getAllOutputAsChunks({ asFlat: true })).toMatchSnapshot('output as chunks'); + expect(provider.getAllOutputAsChunks({ asLines: true })).toMatchSnapshot('output as chunks'); } describe('01 color enabled', () => { diff --git a/libraries/terminal/src/test/__snapshots__/PrefixProxyTerminalProvider.test.ts.snap b/libraries/terminal/src/test/__snapshots__/PrefixProxyTerminalProvider.test.ts.snap index 5743691824..e9427ed63e 100644 --- a/libraries/terminal/src/test/__snapshots__/PrefixProxyTerminalProvider.test.ts.snap +++ b/libraries/terminal/src/test/__snapshots__/PrefixProxyTerminalProvider.test.ts.snap @@ -8,8 +8,8 @@ Object { exports[`PrefixProxyTerminalProvider With a dynamic prefix write writes a message with newlines: output as chunks 1`] = ` Array [ - "[ log] [prefix (0)] message 1[n]", - "[ log] [prefix (1)] message 2[n]", + "[ log] [prefix (0)] message 1", + "[ log] [prefix (1)] message 2", "[ log] [prefix (2)] message 3", ] `; @@ -22,8 +22,8 @@ Object { exports[`PrefixProxyTerminalProvider With a dynamic prefix write writes a message with provider newlines: output as chunks 1`] = ` Array [ - "[ log] [prefix (0)] message 1[n]", - "[ log] [prefix (1)] message 2[n]", + "[ log] [prefix (0)] message 1", + "[ log] [prefix (1)] message 2", "[ log] [prefix (2)] message 3", ] `; @@ -48,11 +48,9 @@ Object { exports[`PrefixProxyTerminalProvider With a dynamic prefix write writes a mix of messages with and without newlines: output as chunks 1`] = ` Array [ - "[ log] [prefix (0)] message 1", - "[ log] message 2[n]", - "[ log] [prefix (1)] message 3[n]", - "[ log] [prefix (2)] message 4", - "[ log] message 5[n]", + "[ log] [prefix (0)] message 1message 2", + "[ log] [prefix (1)] message 3", + "[ log] [prefix (2)] message 4message 5", "[ log] [prefix (3)] message 6", ] `; @@ -65,9 +63,7 @@ Object { exports[`PrefixProxyTerminalProvider With a dynamic prefix write writes messages without newlines: output as chunks 1`] = ` Array [ - "[ log] [prefix (0)] message 1", - "[ log] message 2", - "[ log] message 3", + "[ log] [prefix (0)] message 1message 2message 3", ] `; @@ -79,9 +75,9 @@ Object { exports[`PrefixProxyTerminalProvider With a dynamic prefix writeLine writes a message line with newlines: output as chunks 1`] = ` Array [ - "[ log] [prefix (0)] message 1[n]", - "[ log] [prefix (1)] message 2[n]", - "[ log] [prefix (2)] message 3[n]", + "[ log] [prefix (0)] message 1", + "[ log] [prefix (1)] message 2", + "[ log] [prefix (2)] message 3", ] `; @@ -93,9 +89,9 @@ Object { exports[`PrefixProxyTerminalProvider With a dynamic prefix writeLine writes a message line with provider newlines: output as chunks 1`] = ` Array [ - "[ log] [prefix (0)] message 1[n]", - "[ log] [prefix (1)] message 2[n]", - "[ log] [prefix (2)] message 3[n]", + "[ log] [prefix (0)] message 1", + "[ log] [prefix (1)] message 2", + "[ log] [prefix (2)] message 3", ] `; @@ -107,7 +103,7 @@ Object { exports[`PrefixProxyTerminalProvider With a dynamic prefix writeLine writes a message line: output as chunks 1`] = ` Array [ - "[ log] [prefix (0)] test message[n]", + "[ log] [prefix (0)] test message", ] `; @@ -119,13 +115,13 @@ Object { exports[`PrefixProxyTerminalProvider With a dynamic prefix writeLine writes a mix of message lines with and without newlines: output as chunks 1`] = ` Array [ - "[ log] [prefix (0)] message 1[n]", - "[ log] [prefix (1)] message 2[n]", - "[ log] [prefix (2)] message 3[n]", - "[ log] [prefix (3)] [n]", - "[ log] [prefix (4)] message 4[n]", - "[ log] [prefix (5)] message 5[n]", - "[ log] [prefix (6)] message 6[n]", + "[ log] [prefix (0)] message 1", + "[ log] [prefix (1)] message 2", + "[ log] [prefix (2)] message 3", + "[ log] [prefix (3)] ", + "[ log] [prefix (4)] message 4", + "[ log] [prefix (5)] message 5", + "[ log] [prefix (6)] message 6", ] `; @@ -137,8 +133,8 @@ Object { exports[`PrefixProxyTerminalProvider With a static prefix write writes a message with newlines: output as chunks 1`] = ` Array [ - "[ log] [prefix] message 1[n]", - "[ log] [prefix] message 2[n]", + "[ log] [prefix] message 1", + "[ log] [prefix] message 2", "[ log] [prefix] message 3", ] `; @@ -151,8 +147,8 @@ Object { exports[`PrefixProxyTerminalProvider With a static prefix write writes a message with provider newlines: output as chunks 1`] = ` Array [ - "[ log] [prefix] message 1[n]", - "[ log] [prefix] message 2[n]", + "[ log] [prefix] message 1", + "[ log] [prefix] message 2", "[ log] [prefix] message 3", ] `; @@ -177,11 +173,9 @@ Object { exports[`PrefixProxyTerminalProvider With a static prefix write writes a mix of messages with and without newlines: output as chunks 1`] = ` Array [ - "[ log] [prefix] message 1", - "[ log] message 2[n]", - "[ log] [prefix] message 3[n]", - "[ log] [prefix] message 4", - "[ log] message 5[n]", + "[ log] [prefix] message 1message 2", + "[ log] [prefix] message 3", + "[ log] [prefix] message 4message 5", "[ log] [prefix] message 6", ] `; @@ -194,9 +188,7 @@ Object { exports[`PrefixProxyTerminalProvider With a static prefix write writes messages without newlines: output as chunks 1`] = ` Array [ - "[ log] [prefix] message 1", - "[ log] message 2", - "[ log] message 3", + "[ log] [prefix] message 1message 2message 3", ] `; @@ -208,9 +200,9 @@ Object { exports[`PrefixProxyTerminalProvider With a static prefix writeLine writes a message line with newlines: output as chunks 1`] = ` Array [ - "[ log] [prefix] message 1[n]", - "[ log] [prefix] message 2[n]", - "[ log] [prefix] message 3[n]", + "[ log] [prefix] message 1", + "[ log] [prefix] message 2", + "[ log] [prefix] message 3", ] `; @@ -222,9 +214,9 @@ Object { exports[`PrefixProxyTerminalProvider With a static prefix writeLine writes a message line with provider newlines: output as chunks 1`] = ` Array [ - "[ log] [prefix] message 1[n]", - "[ log] [prefix] message 2[n]", - "[ log] [prefix] message 3[n]", + "[ log] [prefix] message 1", + "[ log] [prefix] message 2", + "[ log] [prefix] message 3", ] `; @@ -236,7 +228,7 @@ Object { exports[`PrefixProxyTerminalProvider With a static prefix writeLine writes a message line: output as chunks 1`] = ` Array [ - "[ log] [prefix] test message[n]", + "[ log] [prefix] test message", ] `; @@ -248,12 +240,12 @@ Object { exports[`PrefixProxyTerminalProvider With a static prefix writeLine writes a mix of message lines with and without newlines: output as chunks 1`] = ` Array [ - "[ log] [prefix] message 1[n]", - "[ log] [prefix] message 2[n]", - "[ log] [prefix] message 3[n]", - "[ log] [prefix] [n]", - "[ log] [prefix] message 4[n]", - "[ log] [prefix] message 5[n]", - "[ log] [prefix] message 6[n]", + "[ log] [prefix] message 1", + "[ log] [prefix] message 2", + "[ log] [prefix] message 3", + "[ log] [prefix] ", + "[ log] [prefix] message 4", + "[ log] [prefix] message 5", + "[ log] [prefix] message 6", ] `; diff --git a/libraries/terminal/src/test/__snapshots__/Terminal.test.ts.snap b/libraries/terminal/src/test/__snapshots__/Terminal.test.ts.snap index 46bd89aae1..42228d7deb 100644 --- a/libraries/terminal/src/test/__snapshots__/Terminal.test.ts.snap +++ b/libraries/terminal/src/test/__snapshots__/Terminal.test.ts.snap @@ -108,7 +108,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 01 writes a single message: output as chunks 1`] = ` Array [ - "[ log] test message[n]", + "[ log] test message", ] `; @@ -124,7 +124,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 02 writes multiple messages: output as chunks 1`] = ` Array [ - "[ log] message 1message 2[n]", + "[ log] message 1message 2", ] `; @@ -140,7 +140,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 03 writes a message with colors: output as chunks 1`] = ` Array [ - "[ log] [green]message 1[default][n]", + "[ log] [green]message 1[default]", ] `; @@ -156,7 +156,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 04 writes a multiple messages with colors: output as chunks 1`] = ` Array [ - "[ log] [green]message 1[default][red]message 2[default][n]", + "[ log] [green]message 1[default][red]message 2[default]", ] `; @@ -172,7 +172,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` Array [ - "[ log] message 1[green]message 2[default]message 3[red]message 4[default][n]", + "[ log] message 1[green]message 2[default]message 3[red]message 4[default]", ] `; @@ -188,7 +188,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` Array [ - "[ log] message 1[green]message 2[default]message 3[red]message 4[default][n]", + "[ log] message 1[green]message 2[default]message 3[red]message 4[default]", ] `; @@ -300,7 +300,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 01 writes a single message: output as chunks 1`] = ` Array [ - "[warning] [yellow]test message[default][n]", + "[warning] [yellow]test message[default]", ] `; @@ -316,7 +316,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 02 writes multiple messages: output as chunks 1`] = ` Array [ - "[warning] [yellow]message 1[default][yellow]message 2[default][n]", + "[warning] [yellow]message 1[default][yellow]message 2[default]", ] `; @@ -332,7 +332,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 03 writes a message with colors: output as chunks 1`] = ` Array [ - "[warning] [yellow]message 1[default][n]", + "[warning] [yellow]message 1[default]", ] `; @@ -348,7 +348,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 04 writes a multiple messages with colors: output as chunks 1`] = ` Array [ - "[warning] [yellow]message 1[default][yellow]message 2[default][n]", + "[warning] [yellow]message 1[default][yellow]message 2[default]", ] `; @@ -364,7 +364,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` Array [ - "[warning] [yellow]message 1[default][yellow]message 2[default][yellow]message 3[default][yellow]message 4[default][n]", + "[warning] [yellow]message 1[default][yellow]message 2[default][yellow]message 3[default][yellow]message 4[default]", ] `; @@ -380,7 +380,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` Array [ - "[warning] message 1[green]message 2[default]message 3[red]message 4[default][n]", + "[warning] message 1[green]message 2[default]message 3[red]message 4[default]", ] `; @@ -492,7 +492,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 01 writes a single message: output as chunks 1`] = ` Array [ - "[ error] [red]test message[default][n]", + "[ error] [red]test message[default]", ] `; @@ -508,7 +508,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 02 writes multiple messages: output as chunks 1`] = ` Array [ - "[ error] [red]message 1[default][red]message 2[default][n]", + "[ error] [red]message 1[default][red]message 2[default]", ] `; @@ -524,7 +524,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 03 writes a message with colors: output as chunks 1`] = ` Array [ - "[ error] [red]message 1[default][n]", + "[ error] [red]message 1[default]", ] `; @@ -540,7 +540,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 04 writes a multiple messages with colors: output as chunks 1`] = ` Array [ - "[ error] [red]message 1[default][red]message 2[default][n]", + "[ error] [red]message 1[default][red]message 2[default]", ] `; @@ -556,7 +556,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` Array [ - "[ error] [red]message 1[default][red]message 2[default][red]message 3[default][red]message 4[default][n]", + "[ error] [red]message 1[default][red]message 2[default][red]message 3[default][red]message 4[default]", ] `; @@ -572,7 +572,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` Array [ - "[ error] message 1[green]message 2[default]message 3[red]message 4[default][n]", + "[ error] message 1[green]message 2[default]message 3[red]message 4[default]", ] `; @@ -684,7 +684,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 01 writes a single message: output as chunks 1`] = ` Array [ - "[verbose] test message[n]", + "[verbose] test message", ] `; @@ -700,7 +700,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 02 writes multiple messages: output as chunks 1`] = ` Array [ - "[verbose] message 1message 2[n]", + "[verbose] message 1message 2", ] `; @@ -716,7 +716,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 03 writes a message with colors: output as chunks 1`] = ` Array [ - "[verbose] [green]message 1[default][n]", + "[verbose] [green]message 1[default]", ] `; @@ -732,7 +732,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 04 writes a multiple messages with colors: output as chunks 1`] = ` Array [ - "[verbose] [green]message 1[default][red]message 2[default][n]", + "[verbose] [green]message 1[default][red]message 2[default]", ] `; @@ -748,7 +748,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` Array [ - "[verbose] message 1[green]message 2[default]message 3[red]message 4[default][n]", + "[verbose] message 1[green]message 2[default]message 3[red]message 4[default]", ] `; @@ -764,7 +764,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` Array [ - "[verbose] message 1[green]message 2[default]message 3[red]message 4[default][n]", + "[verbose] message 1[green]message 2[default]message 3[red]message 4[default]", ] `; @@ -781,44 +781,40 @@ Object { exports[`Terminal 01 color enabled 05 writes to multiple streams: output as chunks 1`] = ` Array [ "[ log] message 1[green]message 2[default]message 3[red]message 4[default]", - "[warning] [yellow]message 1[default][yellow]message 2[default][n]", - "[verbose] test message", - "[verbose] [green]message 1[default]", - "[ log] [green]message 1[default][n]", - "[ error] [red]message 1[default][red]message 2[default][red]message 3[default][red]message 4[default]", - "[ error] [red]test message[default][n]", - "[verbose] message 1[green]message 2[default]message 3[red]message 4[default][n]", - "[verbose] test message[n]", "[warning] [yellow]message 1[default][yellow]message 2[default]", - "[warning] [yellow]message 1[default][yellow]message 2[default][yellow]message 3[default][yellow]message 4[default]", + "[verbose] test message[green]message 1[default]", + "[ log] [green]message 1[default]", + "[ error] [red]message 1[default][red]message 2[default][red]message 3[default][red]message 4[default][red]test message[default]", + "[verbose] message 1[green]message 2[default]message 3[red]message 4[default]", + "[verbose] test message", + "[warning] [yellow]message 1[default][yellow]message 2[default][yellow]message 1[default][yellow]message 2[default][yellow]message 3[default][yellow]message 4[default]", "[ error] [red]message 1[default][red]message 2[default]", "[ log] [green]message 1[default]", "[verbose] message 1[green]message 2[default]message 3[red]message 4[default]", - "[ error] [red]message 1[default][red]message 2[default][n]", + "[ error] [red]message 1[default][red]message 2[default]", + "[ log] [green]message 1[default][red]message 2[default]", + "[verbose] message 1message 2[green]message 1[default]", "[ log] [green]message 1[default][red]message 2[default]", - "[verbose] message 1message 2", - "[verbose] [green]message 1[default][n]", - "[ log] [green]message 1[default][red]message 2[default][n]", "[ error] [red]message 1[default]", - "[warning] [yellow]message 1[default][yellow]message 2[default][yellow]message 3[default][yellow]message 4[default][n]", + "[warning] [yellow]message 1[default][yellow]message 2[default][yellow]message 3[default][yellow]message 4[default]", "[ log] test message", - "[warning] [yellow]test message[default][n]", - "[verbose] [green]message 1[default][red]message 2[default][n]", - "[verbose] message 1message 2[n]", - "[ error] [red]message 1[default][red]message 2[default][red]message 3[default][red]message 4[default][n]", - "[ log] message 1[green]message 2[default]message 3[red]message 4[default][n]", + "[warning] [yellow]test message[default]", + "[verbose] [green]message 1[default][red]message 2[default]", + "[verbose] message 1message 2", + "[ error] [red]message 1[default][red]message 2[default][red]message 3[default][red]message 4[default]", + "[ log] message 1[green]message 2[default]message 3[red]message 4[default]", "[warning] [yellow]message 1[default][yellow]message 2[default]", - "[ error] [red]message 1[default][n]", + "[ error] [red]message 1[default]", "[ log] message 1message 2", "[verbose] [green]message 1[default][red]message 2[default]", "[warning] [yellow]message 1[default]", - "[ log] test message[n]", + "[ log] test message", "[ error] [red]test message[default]", - "[ log] message 1message 2[n]", - "[ error] [red]message 1[default][red]message 2[default][n]", + "[ log] message 1message 2", "[ error] [red]message 1[default][red]message 2[default]", - "[warning] [yellow]message 1[default][yellow]message 2[default][n]", - "[warning] [yellow]message 1[default][n]", + "[ error] [red]message 1[default][red]message 2[default]", + "[warning] [yellow]message 1[default][yellow]message 2[default]", + "[warning] [yellow]message 1[default]", ] `; @@ -930,7 +926,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 01 writes a single message: output as chunks 1`] = ` Array [ - "[ log] test message[n]", + "[ log] test message", ] `; @@ -946,7 +942,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 02 writes multiple messages: output as chunks 1`] = ` Array [ - "[ log] message 1message 2[n]", + "[ log] message 1message 2", ] `; @@ -962,7 +958,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 03 writes a message with colors: output as chunks 1`] = ` Array [ - "[ log] message 1[n]", + "[ log] message 1", ] `; @@ -978,7 +974,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 04 writes a multiple messages with colors: output as chunks 1`] = ` Array [ - "[ log] message 1message 2[n]", + "[ log] message 1message 2", ] `; @@ -994,7 +990,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` Array [ - "[ log] message 1message 2message 3message 4[n]", + "[ log] message 1message 2message 3message 4", ] `; @@ -1010,7 +1006,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` Array [ - "[ log] message 1message 2message 3message 4[n]", + "[ log] message 1message 2message 3message 4", ] `; @@ -1122,7 +1118,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 01 writes a single message: output as chunks 1`] = ` Array [ - "[warning] test message[n]", + "[warning] test message", ] `; @@ -1138,7 +1134,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 02 writes multiple messages: output as chunks 1`] = ` Array [ - "[warning] message 1message 2[n]", + "[warning] message 1message 2", ] `; @@ -1154,7 +1150,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 03 writes a message with colors: output as chunks 1`] = ` Array [ - "[warning] message 1[n]", + "[warning] message 1", ] `; @@ -1170,7 +1166,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 04 writes a multiple messages with colors: output as chunks 1`] = ` Array [ - "[warning] message 1message 2[n]", + "[warning] message 1message 2", ] `; @@ -1186,7 +1182,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` Array [ - "[warning] message 1message 2message 3message 4[n]", + "[warning] message 1message 2message 3message 4", ] `; @@ -1202,7 +1198,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` Array [ - "[warning] message 1message 2message 3message 4[n]", + "[warning] message 1message 2message 3message 4", ] `; @@ -1314,7 +1310,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 01 writes a single message: output as chunks 1`] = ` Array [ - "[ error] test message[n]", + "[ error] test message", ] `; @@ -1330,7 +1326,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 02 writes multiple messages: output as chunks 1`] = ` Array [ - "[ error] message 1message 2[n]", + "[ error] message 1message 2", ] `; @@ -1346,7 +1342,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 03 writes a message with colors: output as chunks 1`] = ` Array [ - "[ error] message 1[n]", + "[ error] message 1", ] `; @@ -1362,7 +1358,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 04 writes a multiple messages with colors: output as chunks 1`] = ` Array [ - "[ error] message 1message 2[n]", + "[ error] message 1message 2", ] `; @@ -1378,7 +1374,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` Array [ - "[ error] message 1message 2message 3message 4[n]", + "[ error] message 1message 2message 3message 4", ] `; @@ -1394,7 +1390,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` Array [ - "[ error] message 1message 2message 3message 4[n]", + "[ error] message 1message 2message 3message 4", ] `; @@ -1506,7 +1502,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 01 writes a single message: output as chunks 1`] = ` Array [ - "[verbose] test message[n]", + "[verbose] test message", ] `; @@ -1522,7 +1518,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 02 writes multiple messages: output as chunks 1`] = ` Array [ - "[verbose] message 1message 2[n]", + "[verbose] message 1message 2", ] `; @@ -1538,7 +1534,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 03 writes a message with colors: output as chunks 1`] = ` Array [ - "[verbose] message 1[n]", + "[verbose] message 1", ] `; @@ -1554,7 +1550,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 04 writes a multiple messages with colors: output as chunks 1`] = ` Array [ - "[verbose] message 1message 2[n]", + "[verbose] message 1message 2", ] `; @@ -1570,7 +1566,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` Array [ - "[verbose] message 1message 2message 3message 4[n]", + "[verbose] message 1message 2message 3message 4", ] `; @@ -1586,7 +1582,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` Array [ - "[verbose] message 1message 2message 3message 4[n]", + "[verbose] message 1message 2message 3message 4", ] `; @@ -1698,7 +1694,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 01 writes a single message: output as chunks 1`] = ` Array [ - "[ debug] test message[n]", + "[ debug] test message", ] `; @@ -1714,7 +1710,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 02 writes multiple messages: output as chunks 1`] = ` Array [ - "[ debug] message 1message 2[n]", + "[ debug] message 1message 2", ] `; @@ -1730,7 +1726,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 03 writes a message with colors: output as chunks 1`] = ` Array [ - "[ debug] message 1[n]", + "[ debug] message 1", ] `; @@ -1746,7 +1742,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 04 writes a multiple messages with colors: output as chunks 1`] = ` Array [ - "[ debug] message 1message 2[n]", + "[ debug] message 1message 2", ] `; @@ -1762,7 +1758,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` Array [ - "[ debug] message 1message 2message 3message 4[n]", + "[ debug] message 1message 2message 3message 4", ] `; @@ -1778,7 +1774,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` Array [ - "[ debug] message 1message 2message 3message 4[n]", + "[ debug] message 1message 2message 3message 4", ] `; @@ -1795,43 +1791,39 @@ Object { exports[`Terminal 02 color disabled 05 writes to multiple streams: output as chunks 1`] = ` Array [ "[ log] message 1message 2message 3message 4", - "[warning] message 1message 2[n]", - "[verbose] test message", - "[verbose] message 1", - "[ log] message 1[n]", - "[ error] message 1message 2message 3message 4", - "[ error] test message[n]", - "[verbose] message 1message 2message 3message 4[n]", - "[verbose] test message[n]", "[warning] message 1message 2", - "[warning] message 1message 2message 3message 4", + "[verbose] test messagemessage 1", + "[ log] message 1", + "[ error] message 1message 2message 3message 4test message", + "[verbose] message 1message 2message 3message 4", + "[verbose] test message", + "[warning] message 1message 2message 1message 2message 3message 4", "[ error] message 1message 2", "[ log] message 1", "[verbose] message 1message 2message 3message 4", - "[ error] message 1message 2[n]", + "[ error] message 1message 2", + "[ log] message 1message 2", + "[verbose] message 1message 2message 1", "[ log] message 1message 2", - "[verbose] message 1message 2", - "[verbose] message 1[n]", - "[ log] message 1message 2[n]", "[ error] message 1", - "[warning] message 1message 2message 3message 4[n]", + "[warning] message 1message 2message 3message 4", "[ log] test message", - "[warning] test message[n]", - "[verbose] message 1message 2[n]", - "[verbose] message 1message 2[n]", - "[ error] message 1message 2message 3message 4[n]", - "[ log] message 1message 2message 3message 4[n]", + "[warning] test message", + "[verbose] message 1message 2", + "[verbose] message 1message 2", + "[ error] message 1message 2message 3message 4", + "[ log] message 1message 2message 3message 4", "[warning] message 1message 2", - "[ error] message 1[n]", + "[ error] message 1", "[ log] message 1message 2", "[verbose] message 1message 2", "[warning] message 1", - "[ log] test message[n]", + "[ log] test message", "[ error] test message", - "[ log] message 1message 2[n]", - "[ error] message 1message 2[n]", + "[ log] message 1message 2", "[ error] message 1message 2", - "[warning] message 1message 2[n]", - "[warning] message 1[n]", + "[ error] message 1message 2", + "[warning] message 1message 2", + "[warning] message 1", ] `; diff --git a/rush-plugins/rush-http-build-cache-plugin/src/test/HttpBuildCacheProvider.test.ts b/rush-plugins/rush-http-build-cache-plugin/src/test/HttpBuildCacheProvider.test.ts index 5629e2e26a..54f5772979 100644 --- a/rush-plugins/rush-http-build-cache-plugin/src/test/HttpBuildCacheProvider.test.ts +++ b/rush-plugins/rush-http-build-cache-plugin/src/test/HttpBuildCacheProvider.test.ts @@ -66,10 +66,16 @@ describe('HttpBuildCacheProvider', () => { redirect: 'follow' }) ); - expect(terminalBuffer.getAllOutputAsChunks({ asFlat: true })).toMatchInlineSnapshot(` + expect(terminalBuffer.getAllOutputAsChunks({ asLines: true })).toMatchInlineSnapshot(` Array [ - "[ debug] [http-build-cache] request: GET https://buildcache.example.acme.com/some-key unknown bytes[n]", - "[warning] Error getting cache entry: Error: Credentials for https://buildcache.example.acme.com/ have not been provided.[n]In CI, verify that RUSH_BUILD_CACHE_CREDENTIAL contains a valid Authorization header value.[n][n]For local developers, run:[n][n] rush update-cloud-credentials --interactive[n][n]", + "[ debug] [http-build-cache] request: GET https://buildcache.example.acme.com/some-key unknown bytes", + "[warning] Error getting cache entry: Error: Credentials for https://buildcache.example.acme.com/ have not been provided.", + "[warning] In CI, verify that RUSH_BUILD_CACHE_CREDENTIAL contains a valid Authorization header value.", + "[warning] ", + "[warning] For local developers, run:", + "[warning] ", + "[warning] rush update-cloud-credentials --interactive", + "[warning] ", ] `); }); @@ -123,12 +129,12 @@ Array [ redirect: 'follow' }) ); - expect(terminalBuffer.getAllOutputAsChunks({ asFlat: true })).toMatchInlineSnapshot(` + expect(terminalBuffer.getAllOutputAsChunks({ asLines: true })).toMatchInlineSnapshot(` Array [ - "[ debug] [http-build-cache] request: GET https://buildcache.example.acme.com/some-key unknown bytes[n]", - "[ debug] [http-build-cache] request: GET https://buildcache.example.acme.com/some-key unknown bytes[n]", - "[ debug] [http-build-cache] request: GET https://buildcache.example.acme.com/some-key unknown bytes[n]", - "[warning] Could not get cache entry: HTTP 504: BadGateway[n]", + "[ debug] [http-build-cache] request: GET https://buildcache.example.acme.com/some-key unknown bytes", + "[ debug] [http-build-cache] request: GET https://buildcache.example.acme.com/some-key unknown bytes", + "[ debug] [http-build-cache] request: GET https://buildcache.example.acme.com/some-key unknown bytes", + "[warning] Could not get cache entry: HTTP 504: BadGateway", ] `); }); From 13517a31a6d717193dd8e179649d6683a96be40c Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Tue, 6 Jan 2026 00:11:12 -0500 Subject: [PATCH 12/14] fixup! Combine sequential logging statements in getAllOutputAsChunks and replace 'asFlat' with 'asLines' --- .../src/StringBufferTerminalProvider.ts | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/libraries/terminal/src/StringBufferTerminalProvider.ts b/libraries/terminal/src/StringBufferTerminalProvider.ts index 20164aaa46..0c5c74c525 100644 --- a/libraries/terminal/src/StringBufferTerminalProvider.ts +++ b/libraries/terminal/src/StringBufferTerminalProvider.ts @@ -53,16 +53,22 @@ export interface IOutputChunk { severity: TerminalProviderSeverityName; } -function _normalizeOutput(s: string, options: IStringBufferOutputOptions | undefined): string { - options = { +function _normalizeOptions( + options: IStringBufferOutputOptions | undefined +): Required { + return { normalizeSpecialCharacters: true, ...(options || {}) }; +} + +function _normalizeOutput(s: string, options: IStringBufferOutputOptions | undefined): string { + const normalizedOptions: Required = _normalizeOptions(options); s = Text.convertToLf(s); - if (options.normalizeSpecialCharacters) { + if (normalizedOptions.normalizeSpecialCharacters) { return AnsiEscape.formatForTests(s, { encodeNewlines: true }); } else { return s; @@ -244,6 +250,7 @@ export class StringBufferTerminalProvider implements ITerminalProvider { ): `[${string}] ${string}`[]; public getAllOutputAsChunks(options: IStringBufferOutputChunksOptions = {}): IOutputChunk[] | string[] { if (options.asLines) { + const normalizedOptions: Required = _normalizeOptions(options); const lines: `[${string}] ${string}`[] = []; for (const { text: rawText, severity: rawSeverity } of this._allOutputChunks) { @@ -264,7 +271,14 @@ export class StringBufferTerminalProvider implements ITerminalProvider { continue; } - const lineText: string = rawLines[i]; + const hasNewlineAfter: boolean = i < rawLines.length - 1; + + // If the original output had a newline after this line, preserve it as the special token + // (e.g. "[-n-]") when normalization is enabled. + const shouldIncludeNewlineToken: boolean = + normalizedOptions.normalizeSpecialCharacters && hasNewlineAfter; + const lineText: string = shouldIncludeNewlineToken ? `${rawLines[i]}\n` : rawLines[i]; + const text: string = _normalizeOutput(lineText, options); lines.push(`[${severity}] ${text}`); } From a54969e7dfe9e8184ab482284d4aecb3ea25a3fc Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Tue, 6 Jan 2026 01:51:19 -0500 Subject: [PATCH 13/14] fixup! Combine sequential logging statements in getAllOutputAsChunks and replace 'asFlat' with 'asLines' --- .../ConfigurationFile.test.ts.snap | 36 ++-- .../test/__snapshots__/parseResx.test.ts.snap | 6 +- .../OperationExecutionManager.test.ts.snap | 18 +- .../RushProjectConfiguration.test.ts.snap | 8 +- .../OperationMetadataManager.test.ts.snap | 12 +- .../PnpmShrinkwrapFile.test.ts.snap | 4 +- .../ProjectImpactGraphGenerator.test.ts.snap | 12 +- .../PrefixProxyTerminalProvider.test.ts.snap | 84 ++++---- .../test/__snapshots__/Terminal.test.ts.snap | 188 +++++++++--------- .../src/test/HttpBuildCacheProvider.test.ts | 24 +-- 10 files changed, 196 insertions(+), 196 deletions(-) diff --git a/libraries/heft-config-file/src/test/__snapshots__/ConfigurationFile.test.ts.snap b/libraries/heft-config-file/src/test/__snapshots__/ConfigurationFile.test.ts.snap index 4f390113ca..5c90062d35 100644 --- a/libraries/heft-config-file/src/test/__snapshots__/ConfigurationFile.test.ts.snap +++ b/libraries/heft-config-file/src/test/__snapshots__/ConfigurationFile.test.ts.snap @@ -176,7 +176,7 @@ exports[`ConfigurationFile error cases Throws an error when a requested file doe exports[`ConfigurationFile error cases Throws an error when a requested file doesn't exist 2`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/errorCases/folderThatDoesntExist/config.json\\" not found.", + "[ debug] Configuration file \\"/lib/test/errorCases/folderThatDoesntExist/config.json\\" not found.[n]", ] `; @@ -184,7 +184,7 @@ exports[`ConfigurationFile error cases Throws an error when a requested file doe exports[`ConfigurationFile error cases Throws an error when a requested file doesn't exist async 2`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/errorCases/folderThatDoesntExist/config.json\\" not found.", + "[ debug] Configuration file \\"/lib/test/errorCases/folderThatDoesntExist/config.json\\" not found.[n]", ] `; @@ -192,7 +192,7 @@ exports[`ConfigurationFile error cases Throws an error when an "extends" propert exports[`ConfigurationFile error cases Throws an error when an "extends" property points to a file that cannot be resolved 2`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/errorCases/extendsNotExist/config2.json\\" not found.", + "[ debug] Configuration file \\"/lib/test/errorCases/extendsNotExist/config2.json\\" not found.[n]", ] `; @@ -200,7 +200,7 @@ exports[`ConfigurationFile error cases Throws an error when an "extends" propert exports[`ConfigurationFile error cases Throws an error when an "extends" property points to a file that cannot be resolved async 2`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/errorCases/extendsNotExist/config2.json\\" not found.", + "[ debug] Configuration file \\"/lib/test/errorCases/extendsNotExist/config2.json\\" not found.[n]", ] `; @@ -218,13 +218,13 @@ exports[`ConfigurationFile error cases Throws an error when there is a circular exports[`ConfigurationFile error cases returns undefined when the file doesn't exist for tryLoadConfigurationFileForProject 1`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/errorCases/invalidType/notExist.json\\" not found.", + "[ debug] Configuration file \\"/lib/test/errorCases/invalidType/notExist.json\\" not found.[n]", ] `; exports[`ConfigurationFile error cases returns undefined when the file doesn't exist for tryLoadConfigurationFileForProjectAsync 1`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/errorCases/invalidType/notExist.json\\" not found.", + "[ debug] Configuration file \\"/lib/test/errorCases/invalidType/notExist.json\\" not found.[n]", ] `; @@ -232,7 +232,7 @@ exports[`ConfigurationFile error cases throws an error when the file doesn't exi exports[`ConfigurationFile error cases throws an error when the file doesn't exist 2`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/errorCases/invalidType/notExist.json\\" not found.", + "[ debug] Configuration file \\"/lib/test/errorCases/invalidType/notExist.json\\" not found.[n]", ] `; @@ -240,31 +240,31 @@ exports[`ConfigurationFile error cases throws an error when the file doesn't exi exports[`ConfigurationFile error cases throws an error when the file doesn't exist async 2`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/errorCases/invalidType/notExist.json\\" not found.", + "[ debug] Configuration file \\"/lib/test/errorCases/invalidType/notExist.json\\" not found.[n]", ] `; exports[`ConfigurationFile loading a rig correctly loads a config file inside a rig 1`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/simplestConfigFile.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").", + "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/simplestConfigFile.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").[n]", ] `; exports[`ConfigurationFile loading a rig correctly loads a config file inside a rig async 1`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/simplestConfigFile.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").", + "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/simplestConfigFile.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").[n]", ] `; exports[`ConfigurationFile loading a rig correctly loads a config file inside a rig via tryLoadConfigurationFileForProject 1`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/simplestConfigFile.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").", + "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/simplestConfigFile.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").[n]", ] `; exports[`ConfigurationFile loading a rig correctly loads a config file inside a rig via tryLoadConfigurationFileForProjectAsync 1`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/simplestConfigFile.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").", + "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/simplestConfigFile.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").[n]", ] `; @@ -272,9 +272,9 @@ exports[`ConfigurationFile loading a rig throws an error when a config file does exports[`ConfigurationFile loading a rig throws an error when a config file doesn't exist in a project referencing a rig, which also doesn't have the file 2`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/notExist.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").", - "[ debug] Configuration file \\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default/config/notExist.json\\" not found.", - "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/notExist.json\\" not found.", + "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/notExist.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").[n]", + "[ debug] Configuration file \\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default/config/notExist.json\\" not found.[n]", + "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/notExist.json\\" not found.[n]", ] `; @@ -282,8 +282,8 @@ exports[`ConfigurationFile loading a rig throws an error when a config file does exports[`ConfigurationFile loading a rig throws an error when a config file doesn't exist in a project referencing a rig, which also doesn't have the file async 2`] = ` Array [ - "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/notExist.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").", - "[ debug] Configuration file \\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default/config/notExist.json\\" not found.", - "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/notExist.json\\" not found.", + "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/notExist.json\\" does not exist. Attempting to load via rig (\\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default\\").[n]", + "[ debug] Configuration file \\"/lib/test/project-referencing-rig/node_modules/test-rig/profiles/default/config/notExist.json\\" not found.[n]", + "[ debug] Configuration file \\"/lib/test/project-referencing-rig/config/notExist.json\\" not found.[n]", ] `; diff --git a/libraries/localization-utilities/src/parsers/test/__snapshots__/parseResx.test.ts.snap b/libraries/localization-utilities/src/parsers/test/__snapshots__/parseResx.test.ts.snap index f826c6d390..8eabd6e39c 100644 --- a/libraries/localization-utilities/src/parsers/test/__snapshots__/parseResx.test.ts.snap +++ b/libraries/localization-utilities/src/parsers/test/__snapshots__/parseResx.test.ts.snap @@ -35,7 +35,7 @@ Object { exports[`parseResx fails to parse a RESX file with a duplicate string: terminal output 1`] = ` Array [ - "[ error] test.resx(6,45): Duplicate string value \\"stringA\\"", + "[ error] test.resx(6,45): Duplicate string value \\"stringA\\"[n]", ] `; @@ -50,7 +50,7 @@ Object { exports[`parseResx ignoreMissingResxComments when set to false, warns on a missing comment: terminal output 1`] = ` Array [ - "[warning] test.resx(3,59): Missing string comment in element", + "[warning] test.resx(3,59): Missing string comment in element[n]", ] `; @@ -113,7 +113,7 @@ Object { exports[`parseResx prints an error on invalid XML: terminal output 1`] = ` Array [ - "[ error] test.resx(3,41): Found unexpected non-empty text node in RESX element", + "[ error] test.resx(3,41): Found unexpected non-empty text node in RESX element[n]", ] `; diff --git a/libraries/operation-graph/src/test/__snapshots__/OperationExecutionManager.test.ts.snap b/libraries/operation-graph/src/test/__snapshots__/OperationExecutionManager.test.ts.snap index 9c845afe5f..34db93d6c8 100644 --- a/libraries/operation-graph/src/test/__snapshots__/OperationExecutionManager.test.ts.snap +++ b/libraries/operation-graph/src/test/__snapshots__/OperationExecutionManager.test.ts.snap @@ -4,54 +4,54 @@ exports[`OperationExecutionManager constructor throws if a dependency is not in exports[`OperationExecutionManager executeAsync single pass blocks on failure 1`] = ` Array [ - "[verbose] Executing a maximum of 1 simultaneous tasks...", + "[verbose] Executing a maximum of 1 simultaneous tasks...[n]", ] `; exports[`OperationExecutionManager executeAsync single pass does not track noops 1`] = ` Array [ - "[verbose] Executing a maximum of 1 simultaneous tasks...", + "[verbose] Executing a maximum of 1 simultaneous tasks...[n]", ] `; exports[`OperationExecutionManager executeAsync single pass executes in order 1`] = ` Array [ - "[verbose] Executing a maximum of 1 simultaneous tasks...", + "[verbose] Executing a maximum of 1 simultaneous tasks...[n]", ] `; exports[`OperationExecutionManager executeAsync single pass handles empty input 1`] = ` Array [ - "[verbose] Executing a maximum of 0 simultaneous tasks...", + "[verbose] Executing a maximum of 0 simultaneous tasks...[n]", ] `; exports[`OperationExecutionManager executeAsync single pass handles trivial input 1`] = ` Array [ - "[verbose] Executing a maximum of 1 simultaneous tasks...", + "[verbose] Executing a maximum of 1 simultaneous tasks...[n]", ] `; exports[`OperationExecutionManager executeAsync single pass respects concurrency 1`] = ` Array [ - "[verbose] Executing a maximum of 2 simultaneous tasks...", + "[verbose] Executing a maximum of 2 simultaneous tasks...[n]", ] `; exports[`OperationExecutionManager executeAsync single pass respects priority order 1`] = ` Array [ - "[verbose] Executing a maximum of 1 simultaneous tasks...", + "[verbose] Executing a maximum of 1 simultaneous tasks...[n]", ] `; exports[`OperationExecutionManager executeAsync watch mode executes in order: first 1`] = ` Array [ - "[verbose] Executing a maximum of 1 simultaneous tasks...", + "[verbose] Executing a maximum of 1 simultaneous tasks...[n]", ] `; exports[`OperationExecutionManager executeAsync watch mode executes in order: second 1`] = ` Array [ - "[verbose] Executing a maximum of 1 simultaneous tasks...", + "[verbose] Executing a maximum of 1 simultaneous tasks...[n]", ] `; diff --git a/libraries/rush-lib/src/api/test/__snapshots__/RushProjectConfiguration.test.ts.snap b/libraries/rush-lib/src/api/test/__snapshots__/RushProjectConfiguration.test.ts.snap index aace898034..987a503a40 100644 --- a/libraries/rush-lib/src/api/test/__snapshots__/RushProjectConfiguration.test.ts.snap +++ b/libraries/rush-lib/src/api/test/__snapshots__/RushProjectConfiguration.test.ts.snap @@ -32,7 +32,7 @@ Map { exports[`RushProjectConfiguration operationSettingsByOperationName does not allow one outputFolderName to be under another 1`] = ` Array [ - "[ error] The project \\"test-project-d\\" has a \\"config/rush-project.json\\" configuration that defines two operations in the same command whose \\"outputFolderNames\\" would overlap. Operations outputs in the same command must be disjoint so that they can be independently cached. The \\"a/b\\" path overlaps between these operations: \\"_phase:b\\", \\"_phase:a\\"", + "[ error] The project \\"test-project-d\\" has a \\"config/rush-project.json\\" configuration that defines two operations in the same command whose \\"outputFolderNames\\" would overlap. Operations outputs in the same command must be disjoint so that they can be independently cached. The \\"a/b\\" path overlaps between these operations: \\"_phase:b\\", \\"_phase:a\\"[n]", ] `; @@ -60,18 +60,18 @@ exports[`RushProjectConfiguration operationSettingsByOperationName throws an err exports[`RushProjectConfiguration operationSettingsByOperationName validates mix of existent and nonexistent parameters 1`] = ` Array [ - "[ error] The project \\"test-project-g\\" has a \\"config/rush-project.json\\" configuration that specifies invalid parameter(s) in \\"parameterNamesToIgnore\\" for operation \\"_phase:build\\": --nonexistent-param. Valid parameters for this operation are: --production, --verbose.", + "[ error] The project \\"test-project-g\\" has a \\"config/rush-project.json\\" configuration that specifies invalid parameter(s) in \\"parameterNamesToIgnore\\" for operation \\"_phase:build\\": --nonexistent-param. Valid parameters for this operation are: --production, --verbose.[n]", ] `; exports[`RushProjectConfiguration operationSettingsByOperationName validates nonexistent parameters when operation has valid parameters 1`] = ` Array [ - "[ error] The project \\"test-project-f\\" has a \\"config/rush-project.json\\" configuration that specifies invalid parameter(s) in \\"parameterNamesToIgnore\\" for operation \\"_phase:build\\": --nonexistent-param, --another-nonexistent. Valid parameters for this operation are: --production, --verbose.", + "[ error] The project \\"test-project-f\\" has a \\"config/rush-project.json\\" configuration that specifies invalid parameter(s) in \\"parameterNamesToIgnore\\" for operation \\"_phase:build\\": --nonexistent-param, --another-nonexistent. Valid parameters for this operation are: --production, --verbose.[n]", ] `; exports[`RushProjectConfiguration operationSettingsByOperationName validates that parameters in parameterNamesToIgnore exist for the operation 1`] = ` Array [ - "[ error] The project \\"test-project-e\\" has a \\"config/rush-project.json\\" configuration that specifies invalid parameter(s) in \\"parameterNamesToIgnore\\" for operation \\"_phase:build\\": --invalid-parameter, --another-invalid, -malformed-parameter. Valid parameters for this operation are: (none).", + "[ error] The project \\"test-project-e\\" has a \\"config/rush-project.json\\" configuration that specifies invalid parameter(s) in \\"parameterNamesToIgnore\\" for operation \\"_phase:build\\": --invalid-parameter, --another-invalid, -malformed-parameter. Valid parameters for this operation are: (none).[n]", ] `; diff --git a/libraries/rush-lib/src/logic/operations/test/__snapshots__/OperationMetadataManager.test.ts.snap b/libraries/rush-lib/src/logic/operations/test/__snapshots__/OperationMetadataManager.test.ts.snap index d3fd74b75d..01ae0ceb12 100644 --- a/libraries/rush-lib/src/logic/operations/test/__snapshots__/OperationMetadataManager.test.ts.snap +++ b/libraries/rush-lib/src/logic/operations/test/__snapshots__/OperationMetadataManager.test.ts.snap @@ -11,21 +11,21 @@ Array [ exports[`OperationMetadataManager should restore chunked stderr 1`] = ` Array [ - "[ error] chunk1", - "[ error] chunk2", + "[ error] chunk1[n]", + "[ error] chunk2[n]", ] `; exports[`OperationMetadataManager should restore chunked stdout 1`] = ` Array [ - "[ log] chunk1", - "[ log] chunk2", + "[ log] chunk1[n]", + "[ log] chunk2[n]", ] `; exports[`OperationMetadataManager should restore mixed chunked output 1`] = ` Array [ - "[ log] logged to stdout", - "[ error] logged to stderr", + "[ log] logged to stdout[n]", + "[ error] logged to stderr[n]", ] `; diff --git a/libraries/rush-lib/src/logic/pnpm/test/__snapshots__/PnpmShrinkwrapFile.test.ts.snap b/libraries/rush-lib/src/logic/pnpm/test/__snapshots__/PnpmShrinkwrapFile.test.ts.snap index 3d7e356ebc..c46bed8ff9 100644 --- a/libraries/rush-lib/src/logic/pnpm/test/__snapshots__/PnpmShrinkwrapFile.test.ts.snap +++ b/libraries/rush-lib/src/logic/pnpm/test/__snapshots__/PnpmShrinkwrapFile.test.ts.snap @@ -2,7 +2,7 @@ exports[`PnpmShrinkwrapFile Check is workspace project modified pnpm lockfile major version 9 sha1 integrity can be handled when disallowInsecureSha1 1`] = ` Array [ - "[ error] Error: An integrity field with \\"sha1\\" was detected in the pnpm-lock.yaml file located in subspace default; this conflicts with the \\"disallowInsecureSha1\\" policy from pnpm-config.json.", - "[ error] ", + "[ error] Error: An integrity field with \\"sha1\\" was detected in the pnpm-lock.yaml file located in subspace default; this conflicts with the \\"disallowInsecureSha1\\" policy from pnpm-config.json.[n]", + "[ error] [n]", ] `; diff --git a/libraries/rush-lib/src/logic/test/__snapshots__/ProjectImpactGraphGenerator.test.ts.snap b/libraries/rush-lib/src/logic/test/__snapshots__/ProjectImpactGraphGenerator.test.ts.snap index fa265e9059..3aaa6fe9db 100644 --- a/libraries/rush-lib/src/logic/test/__snapshots__/ProjectImpactGraphGenerator.test.ts.snap +++ b/libraries/rush-lib/src/logic/test/__snapshots__/ProjectImpactGraphGenerator.test.ts.snap @@ -93,8 +93,8 @@ exports[`ProjectImpactGraphGenerator generateAsync Correctly generates a project exports[`ProjectImpactGraphGenerator generateAsync Correctly generates a project impact graph (repo: ""packages""): Terminal Output 1`] = ` Array [ - "[ log] ", - "[ log] [green]Generate project impact graph successfully. (1.50 seconds)[default]", + "[ log] [n]", + "[ log] [green]Generate project impact graph successfully. (1.50 seconds)[default][n]", ] `; @@ -167,8 +167,8 @@ exports[`ProjectImpactGraphGenerator generateAsync Correctly generates a project exports[`ProjectImpactGraphGenerator generateAsync Correctly generates a project impact graph (repo: ""repo""): Terminal Output 1`] = ` Array [ - "[ log] ", - "[ log] [green]Generate project impact graph successfully. (1.50 seconds)[default]", + "[ log] [n]", + "[ log] [green]Generate project impact graph successfully. (1.50 seconds)[default][n]", ] `; @@ -267,8 +267,8 @@ exports[`ProjectImpactGraphGenerator generateAsync Correctly generates a project exports[`ProjectImpactGraphGenerator generateAsync Correctly generates a project impact graph (repo: ""workspacePackages""): Terminal Output 1`] = ` Array [ - "[ log] ", - "[ log] [green]Generate project impact graph successfully. (1.50 seconds)[default]", + "[ log] [n]", + "[ log] [green]Generate project impact graph successfully. (1.50 seconds)[default][n]", ] `; diff --git a/libraries/terminal/src/test/__snapshots__/PrefixProxyTerminalProvider.test.ts.snap b/libraries/terminal/src/test/__snapshots__/PrefixProxyTerminalProvider.test.ts.snap index e9427ed63e..6e4d059b57 100644 --- a/libraries/terminal/src/test/__snapshots__/PrefixProxyTerminalProvider.test.ts.snap +++ b/libraries/terminal/src/test/__snapshots__/PrefixProxyTerminalProvider.test.ts.snap @@ -8,8 +8,8 @@ Object { exports[`PrefixProxyTerminalProvider With a dynamic prefix write writes a message with newlines: output as chunks 1`] = ` Array [ - "[ log] [prefix (0)] message 1", - "[ log] [prefix (1)] message 2", + "[ log] [prefix (0)] message 1[n]", + "[ log] [prefix (1)] message 2[n]", "[ log] [prefix (2)] message 3", ] `; @@ -22,8 +22,8 @@ Object { exports[`PrefixProxyTerminalProvider With a dynamic prefix write writes a message with provider newlines: output as chunks 1`] = ` Array [ - "[ log] [prefix (0)] message 1", - "[ log] [prefix (1)] message 2", + "[ log] [prefix (0)] message 1[n]", + "[ log] [prefix (1)] message 2[n]", "[ log] [prefix (2)] message 3", ] `; @@ -48,9 +48,9 @@ Object { exports[`PrefixProxyTerminalProvider With a dynamic prefix write writes a mix of messages with and without newlines: output as chunks 1`] = ` Array [ - "[ log] [prefix (0)] message 1message 2", - "[ log] [prefix (1)] message 3", - "[ log] [prefix (2)] message 4message 5", + "[ log] [prefix (0)] message 1message 2[n]", + "[ log] [prefix (1)] message 3[n]", + "[ log] [prefix (2)] message 4message 5[n]", "[ log] [prefix (3)] message 6", ] `; @@ -75,9 +75,9 @@ Object { exports[`PrefixProxyTerminalProvider With a dynamic prefix writeLine writes a message line with newlines: output as chunks 1`] = ` Array [ - "[ log] [prefix (0)] message 1", - "[ log] [prefix (1)] message 2", - "[ log] [prefix (2)] message 3", + "[ log] [prefix (0)] message 1[n]", + "[ log] [prefix (1)] message 2[n]", + "[ log] [prefix (2)] message 3[n]", ] `; @@ -89,9 +89,9 @@ Object { exports[`PrefixProxyTerminalProvider With a dynamic prefix writeLine writes a message line with provider newlines: output as chunks 1`] = ` Array [ - "[ log] [prefix (0)] message 1", - "[ log] [prefix (1)] message 2", - "[ log] [prefix (2)] message 3", + "[ log] [prefix (0)] message 1[n]", + "[ log] [prefix (1)] message 2[n]", + "[ log] [prefix (2)] message 3[n]", ] `; @@ -103,7 +103,7 @@ Object { exports[`PrefixProxyTerminalProvider With a dynamic prefix writeLine writes a message line: output as chunks 1`] = ` Array [ - "[ log] [prefix (0)] test message", + "[ log] [prefix (0)] test message[n]", ] `; @@ -115,13 +115,13 @@ Object { exports[`PrefixProxyTerminalProvider With a dynamic prefix writeLine writes a mix of message lines with and without newlines: output as chunks 1`] = ` Array [ - "[ log] [prefix (0)] message 1", - "[ log] [prefix (1)] message 2", - "[ log] [prefix (2)] message 3", - "[ log] [prefix (3)] ", - "[ log] [prefix (4)] message 4", - "[ log] [prefix (5)] message 5", - "[ log] [prefix (6)] message 6", + "[ log] [prefix (0)] message 1[n]", + "[ log] [prefix (1)] message 2[n]", + "[ log] [prefix (2)] message 3[n]", + "[ log] [prefix (3)] [n]", + "[ log] [prefix (4)] message 4[n]", + "[ log] [prefix (5)] message 5[n]", + "[ log] [prefix (6)] message 6[n]", ] `; @@ -133,8 +133,8 @@ Object { exports[`PrefixProxyTerminalProvider With a static prefix write writes a message with newlines: output as chunks 1`] = ` Array [ - "[ log] [prefix] message 1", - "[ log] [prefix] message 2", + "[ log] [prefix] message 1[n]", + "[ log] [prefix] message 2[n]", "[ log] [prefix] message 3", ] `; @@ -147,8 +147,8 @@ Object { exports[`PrefixProxyTerminalProvider With a static prefix write writes a message with provider newlines: output as chunks 1`] = ` Array [ - "[ log] [prefix] message 1", - "[ log] [prefix] message 2", + "[ log] [prefix] message 1[n]", + "[ log] [prefix] message 2[n]", "[ log] [prefix] message 3", ] `; @@ -173,9 +173,9 @@ Object { exports[`PrefixProxyTerminalProvider With a static prefix write writes a mix of messages with and without newlines: output as chunks 1`] = ` Array [ - "[ log] [prefix] message 1message 2", - "[ log] [prefix] message 3", - "[ log] [prefix] message 4message 5", + "[ log] [prefix] message 1message 2[n]", + "[ log] [prefix] message 3[n]", + "[ log] [prefix] message 4message 5[n]", "[ log] [prefix] message 6", ] `; @@ -200,9 +200,9 @@ Object { exports[`PrefixProxyTerminalProvider With a static prefix writeLine writes a message line with newlines: output as chunks 1`] = ` Array [ - "[ log] [prefix] message 1", - "[ log] [prefix] message 2", - "[ log] [prefix] message 3", + "[ log] [prefix] message 1[n]", + "[ log] [prefix] message 2[n]", + "[ log] [prefix] message 3[n]", ] `; @@ -214,9 +214,9 @@ Object { exports[`PrefixProxyTerminalProvider With a static prefix writeLine writes a message line with provider newlines: output as chunks 1`] = ` Array [ - "[ log] [prefix] message 1", - "[ log] [prefix] message 2", - "[ log] [prefix] message 3", + "[ log] [prefix] message 1[n]", + "[ log] [prefix] message 2[n]", + "[ log] [prefix] message 3[n]", ] `; @@ -228,7 +228,7 @@ Object { exports[`PrefixProxyTerminalProvider With a static prefix writeLine writes a message line: output as chunks 1`] = ` Array [ - "[ log] [prefix] test message", + "[ log] [prefix] test message[n]", ] `; @@ -240,12 +240,12 @@ Object { exports[`PrefixProxyTerminalProvider With a static prefix writeLine writes a mix of message lines with and without newlines: output as chunks 1`] = ` Array [ - "[ log] [prefix] message 1", - "[ log] [prefix] message 2", - "[ log] [prefix] message 3", - "[ log] [prefix] ", - "[ log] [prefix] message 4", - "[ log] [prefix] message 5", - "[ log] [prefix] message 6", + "[ log] [prefix] message 1[n]", + "[ log] [prefix] message 2[n]", + "[ log] [prefix] message 3[n]", + "[ log] [prefix] [n]", + "[ log] [prefix] message 4[n]", + "[ log] [prefix] message 5[n]", + "[ log] [prefix] message 6[n]", ] `; diff --git a/libraries/terminal/src/test/__snapshots__/Terminal.test.ts.snap b/libraries/terminal/src/test/__snapshots__/Terminal.test.ts.snap index 42228d7deb..39ecc7bbbf 100644 --- a/libraries/terminal/src/test/__snapshots__/Terminal.test.ts.snap +++ b/libraries/terminal/src/test/__snapshots__/Terminal.test.ts.snap @@ -108,7 +108,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 01 writes a single message: output as chunks 1`] = ` Array [ - "[ log] test message", + "[ log] test message[n]", ] `; @@ -124,7 +124,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 02 writes multiple messages: output as chunks 1`] = ` Array [ - "[ log] message 1message 2", + "[ log] message 1message 2[n]", ] `; @@ -140,7 +140,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 03 writes a message with colors: output as chunks 1`] = ` Array [ - "[ log] [green]message 1[default]", + "[ log] [green]message 1[default][n]", ] `; @@ -156,7 +156,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 04 writes a multiple messages with colors: output as chunks 1`] = ` Array [ - "[ log] [green]message 1[default][red]message 2[default]", + "[ log] [green]message 1[default][red]message 2[default][n]", ] `; @@ -172,7 +172,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` Array [ - "[ log] message 1[green]message 2[default]message 3[red]message 4[default]", + "[ log] message 1[green]message 2[default]message 3[red]message 4[default][n]", ] `; @@ -188,7 +188,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 02 writeLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` Array [ - "[ log] message 1[green]message 2[default]message 3[red]message 4[default]", + "[ log] message 1[green]message 2[default]message 3[red]message 4[default][n]", ] `; @@ -300,7 +300,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 01 writes a single message: output as chunks 1`] = ` Array [ - "[warning] [yellow]test message[default]", + "[warning] [yellow]test message[default][n]", ] `; @@ -316,7 +316,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 02 writes multiple messages: output as chunks 1`] = ` Array [ - "[warning] [yellow]message 1[default][yellow]message 2[default]", + "[warning] [yellow]message 1[default][yellow]message 2[default][n]", ] `; @@ -332,7 +332,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 03 writes a message with colors: output as chunks 1`] = ` Array [ - "[warning] [yellow]message 1[default]", + "[warning] [yellow]message 1[default][n]", ] `; @@ -348,7 +348,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 04 writes a multiple messages with colors: output as chunks 1`] = ` Array [ - "[warning] [yellow]message 1[default][yellow]message 2[default]", + "[warning] [yellow]message 1[default][yellow]message 2[default][n]", ] `; @@ -364,7 +364,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` Array [ - "[warning] [yellow]message 1[default][yellow]message 2[default][yellow]message 3[default][yellow]message 4[default]", + "[warning] [yellow]message 1[default][yellow]message 2[default][yellow]message 3[default][yellow]message 4[default][n]", ] `; @@ -380,7 +380,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 04 writeWarningLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` Array [ - "[warning] message 1[green]message 2[default]message 3[red]message 4[default]", + "[warning] message 1[green]message 2[default]message 3[red]message 4[default][n]", ] `; @@ -492,7 +492,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 01 writes a single message: output as chunks 1`] = ` Array [ - "[ error] [red]test message[default]", + "[ error] [red]test message[default][n]", ] `; @@ -508,7 +508,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 02 writes multiple messages: output as chunks 1`] = ` Array [ - "[ error] [red]message 1[default][red]message 2[default]", + "[ error] [red]message 1[default][red]message 2[default][n]", ] `; @@ -524,7 +524,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 03 writes a message with colors: output as chunks 1`] = ` Array [ - "[ error] [red]message 1[default]", + "[ error] [red]message 1[default][n]", ] `; @@ -540,7 +540,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 04 writes a multiple messages with colors: output as chunks 1`] = ` Array [ - "[ error] [red]message 1[default][red]message 2[default]", + "[ error] [red]message 1[default][red]message 2[default][n]", ] `; @@ -556,7 +556,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` Array [ - "[ error] [red]message 1[default][red]message 2[default][red]message 3[default][red]message 4[default]", + "[ error] [red]message 1[default][red]message 2[default][red]message 3[default][red]message 4[default][n]", ] `; @@ -572,7 +572,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 06 writeErrorLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` Array [ - "[ error] message 1[green]message 2[default]message 3[red]message 4[default]", + "[ error] message 1[green]message 2[default]message 3[red]message 4[default][n]", ] `; @@ -684,7 +684,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 01 writes a single message: output as chunks 1`] = ` Array [ - "[verbose] test message", + "[verbose] test message[n]", ] `; @@ -700,7 +700,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 02 writes multiple messages: output as chunks 1`] = ` Array [ - "[verbose] message 1message 2", + "[verbose] message 1message 2[n]", ] `; @@ -716,7 +716,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 03 writes a message with colors: output as chunks 1`] = ` Array [ - "[verbose] [green]message 1[default]", + "[verbose] [green]message 1[default][n]", ] `; @@ -732,7 +732,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 04 writes a multiple messages with colors: output as chunks 1`] = ` Array [ - "[verbose] [green]message 1[default][red]message 2[default]", + "[verbose] [green]message 1[default][red]message 2[default][n]", ] `; @@ -748,7 +748,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` Array [ - "[verbose] message 1[green]message 2[default]message 3[red]message 4[default]", + "[verbose] message 1[green]message 2[default]message 3[red]message 4[default][n]", ] `; @@ -764,7 +764,7 @@ Object { exports[`Terminal 01 color enabled 01 basic terminal functions 08 writeVerboseLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` Array [ - "[verbose] message 1[green]message 2[default]message 3[red]message 4[default]", + "[verbose] message 1[green]message 2[default]message 3[red]message 4[default][n]", ] `; @@ -781,40 +781,40 @@ Object { exports[`Terminal 01 color enabled 05 writes to multiple streams: output as chunks 1`] = ` Array [ "[ log] message 1[green]message 2[default]message 3[red]message 4[default]", - "[warning] [yellow]message 1[default][yellow]message 2[default]", + "[warning] [yellow]message 1[default][yellow]message 2[default][n]", "[verbose] test message[green]message 1[default]", - "[ log] [green]message 1[default]", - "[ error] [red]message 1[default][red]message 2[default][red]message 3[default][red]message 4[default][red]test message[default]", - "[verbose] message 1[green]message 2[default]message 3[red]message 4[default]", - "[verbose] test message", + "[ log] [green]message 1[default][n]", + "[ error] [red]message 1[default][red]message 2[default][red]message 3[default][red]message 4[default][red]test message[default][n]", + "[verbose] message 1[green]message 2[default]message 3[red]message 4[default][n]", + "[verbose] test message[n]", "[warning] [yellow]message 1[default][yellow]message 2[default][yellow]message 1[default][yellow]message 2[default][yellow]message 3[default][yellow]message 4[default]", "[ error] [red]message 1[default][red]message 2[default]", "[ log] [green]message 1[default]", "[verbose] message 1[green]message 2[default]message 3[red]message 4[default]", - "[ error] [red]message 1[default][red]message 2[default]", - "[ log] [green]message 1[default][red]message 2[default]", - "[verbose] message 1message 2[green]message 1[default]", + "[ error] [red]message 1[default][red]message 2[default][n]", "[ log] [green]message 1[default][red]message 2[default]", + "[verbose] message 1message 2[green]message 1[default][n]", + "[ log] [green]message 1[default][red]message 2[default][n]", "[ error] [red]message 1[default]", - "[warning] [yellow]message 1[default][yellow]message 2[default][yellow]message 3[default][yellow]message 4[default]", + "[warning] [yellow]message 1[default][yellow]message 2[default][yellow]message 3[default][yellow]message 4[default][n]", "[ log] test message", - "[warning] [yellow]test message[default]", - "[verbose] [green]message 1[default][red]message 2[default]", - "[verbose] message 1message 2", - "[ error] [red]message 1[default][red]message 2[default][red]message 3[default][red]message 4[default]", - "[ log] message 1[green]message 2[default]message 3[red]message 4[default]", + "[warning] [yellow]test message[default][n]", + "[verbose] [green]message 1[default][red]message 2[default][n]", + "[verbose] message 1message 2[n]", + "[ error] [red]message 1[default][red]message 2[default][red]message 3[default][red]message 4[default][n]", + "[ log] message 1[green]message 2[default]message 3[red]message 4[default][n]", "[warning] [yellow]message 1[default][yellow]message 2[default]", - "[ error] [red]message 1[default]", + "[ error] [red]message 1[default][n]", "[ log] message 1message 2", "[verbose] [green]message 1[default][red]message 2[default]", "[warning] [yellow]message 1[default]", - "[ log] test message", + "[ log] test message[n]", "[ error] [red]test message[default]", - "[ log] message 1message 2", - "[ error] [red]message 1[default][red]message 2[default]", + "[ log] message 1message 2[n]", + "[ error] [red]message 1[default][red]message 2[default][n]", "[ error] [red]message 1[default][red]message 2[default]", - "[warning] [yellow]message 1[default][yellow]message 2[default]", - "[warning] [yellow]message 1[default]", + "[warning] [yellow]message 1[default][yellow]message 2[default][n]", + "[warning] [yellow]message 1[default][n]", ] `; @@ -926,7 +926,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 01 writes a single message: output as chunks 1`] = ` Array [ - "[ log] test message", + "[ log] test message[n]", ] `; @@ -942,7 +942,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 02 writes multiple messages: output as chunks 1`] = ` Array [ - "[ log] message 1message 2", + "[ log] message 1message 2[n]", ] `; @@ -958,7 +958,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 03 writes a message with colors: output as chunks 1`] = ` Array [ - "[ log] message 1", + "[ log] message 1[n]", ] `; @@ -974,7 +974,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 04 writes a multiple messages with colors: output as chunks 1`] = ` Array [ - "[ log] message 1message 2", + "[ log] message 1message 2[n]", ] `; @@ -990,7 +990,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` Array [ - "[ log] message 1message 2message 3message 4", + "[ log] message 1message 2message 3message 4[n]", ] `; @@ -1006,7 +1006,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 02 writeLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` Array [ - "[ log] message 1message 2message 3message 4", + "[ log] message 1message 2message 3message 4[n]", ] `; @@ -1118,7 +1118,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 01 writes a single message: output as chunks 1`] = ` Array [ - "[warning] test message", + "[warning] test message[n]", ] `; @@ -1134,7 +1134,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 02 writes multiple messages: output as chunks 1`] = ` Array [ - "[warning] message 1message 2", + "[warning] message 1message 2[n]", ] `; @@ -1150,7 +1150,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 03 writes a message with colors: output as chunks 1`] = ` Array [ - "[warning] message 1", + "[warning] message 1[n]", ] `; @@ -1166,7 +1166,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 04 writes a multiple messages with colors: output as chunks 1`] = ` Array [ - "[warning] message 1message 2", + "[warning] message 1message 2[n]", ] `; @@ -1182,7 +1182,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` Array [ - "[warning] message 1message 2message 3message 4", + "[warning] message 1message 2message 3message 4[n]", ] `; @@ -1198,7 +1198,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 04 writeWarningLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` Array [ - "[warning] message 1message 2message 3message 4", + "[warning] message 1message 2message 3message 4[n]", ] `; @@ -1310,7 +1310,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 01 writes a single message: output as chunks 1`] = ` Array [ - "[ error] test message", + "[ error] test message[n]", ] `; @@ -1326,7 +1326,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 02 writes multiple messages: output as chunks 1`] = ` Array [ - "[ error] message 1message 2", + "[ error] message 1message 2[n]", ] `; @@ -1342,7 +1342,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 03 writes a message with colors: output as chunks 1`] = ` Array [ - "[ error] message 1", + "[ error] message 1[n]", ] `; @@ -1358,7 +1358,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 04 writes a multiple messages with colors: output as chunks 1`] = ` Array [ - "[ error] message 1message 2", + "[ error] message 1message 2[n]", ] `; @@ -1374,7 +1374,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` Array [ - "[ error] message 1message 2message 3message 4", + "[ error] message 1message 2message 3message 4[n]", ] `; @@ -1390,7 +1390,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 06 writeErrorLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` Array [ - "[ error] message 1message 2message 3message 4", + "[ error] message 1message 2message 3message 4[n]", ] `; @@ -1502,7 +1502,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 01 writes a single message: output as chunks 1`] = ` Array [ - "[verbose] test message", + "[verbose] test message[n]", ] `; @@ -1518,7 +1518,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 02 writes multiple messages: output as chunks 1`] = ` Array [ - "[verbose] message 1message 2", + "[verbose] message 1message 2[n]", ] `; @@ -1534,7 +1534,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 03 writes a message with colors: output as chunks 1`] = ` Array [ - "[verbose] message 1", + "[verbose] message 1[n]", ] `; @@ -1550,7 +1550,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 04 writes a multiple messages with colors: output as chunks 1`] = ` Array [ - "[verbose] message 1message 2", + "[verbose] message 1message 2[n]", ] `; @@ -1566,7 +1566,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` Array [ - "[verbose] message 1message 2message 3message 4", + "[verbose] message 1message 2message 3message 4[n]", ] `; @@ -1582,7 +1582,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 08 writeVerboseLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` Array [ - "[verbose] message 1message 2message 3message 4", + "[verbose] message 1message 2message 3message 4[n]", ] `; @@ -1694,7 +1694,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 01 writes a single message: output as chunks 1`] = ` Array [ - "[ debug] test message", + "[ debug] test message[n]", ] `; @@ -1710,7 +1710,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 02 writes multiple messages: output as chunks 1`] = ` Array [ - "[ debug] message 1message 2", + "[ debug] message 1message 2[n]", ] `; @@ -1726,7 +1726,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 03 writes a message with colors: output as chunks 1`] = ` Array [ - "[ debug] message 1", + "[ debug] message 1[n]", ] `; @@ -1742,7 +1742,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 04 writes a multiple messages with colors: output as chunks 1`] = ` Array [ - "[ debug] message 1message 2", + "[ debug] message 1message 2[n]", ] `; @@ -1758,7 +1758,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 05 writes a messages with colors interspersed with non-colored messages: output as chunks 1`] = ` Array [ - "[ debug] message 1message 2message 3message 4", + "[ debug] message 1message 2message 3message 4[n]", ] `; @@ -1774,7 +1774,7 @@ Object { exports[`Terminal 02 color disabled 01 basic terminal functions 10 writeDebugLine 06 writes a messages with colors interspersed with non-colored messages with color overriding disabled: output as chunks 1`] = ` Array [ - "[ debug] message 1message 2message 3message 4", + "[ debug] message 1message 2message 3message 4[n]", ] `; @@ -1791,39 +1791,39 @@ Object { exports[`Terminal 02 color disabled 05 writes to multiple streams: output as chunks 1`] = ` Array [ "[ log] message 1message 2message 3message 4", - "[warning] message 1message 2", + "[warning] message 1message 2[n]", "[verbose] test messagemessage 1", - "[ log] message 1", - "[ error] message 1message 2message 3message 4test message", - "[verbose] message 1message 2message 3message 4", - "[verbose] test message", + "[ log] message 1[n]", + "[ error] message 1message 2message 3message 4test message[n]", + "[verbose] message 1message 2message 3message 4[n]", + "[verbose] test message[n]", "[warning] message 1message 2message 1message 2message 3message 4", "[ error] message 1message 2", "[ log] message 1", "[verbose] message 1message 2message 3message 4", - "[ error] message 1message 2", - "[ log] message 1message 2", - "[verbose] message 1message 2message 1", + "[ error] message 1message 2[n]", "[ log] message 1message 2", + "[verbose] message 1message 2message 1[n]", + "[ log] message 1message 2[n]", "[ error] message 1", - "[warning] message 1message 2message 3message 4", + "[warning] message 1message 2message 3message 4[n]", "[ log] test message", - "[warning] test message", - "[verbose] message 1message 2", - "[verbose] message 1message 2", - "[ error] message 1message 2message 3message 4", - "[ log] message 1message 2message 3message 4", + "[warning] test message[n]", + "[verbose] message 1message 2[n]", + "[verbose] message 1message 2[n]", + "[ error] message 1message 2message 3message 4[n]", + "[ log] message 1message 2message 3message 4[n]", "[warning] message 1message 2", - "[ error] message 1", + "[ error] message 1[n]", "[ log] message 1message 2", "[verbose] message 1message 2", "[warning] message 1", - "[ log] test message", + "[ log] test message[n]", "[ error] test message", - "[ log] message 1message 2", - "[ error] message 1message 2", + "[ log] message 1message 2[n]", + "[ error] message 1message 2[n]", "[ error] message 1message 2", - "[warning] message 1message 2", - "[warning] message 1", + "[warning] message 1message 2[n]", + "[warning] message 1[n]", ] `; diff --git a/rush-plugins/rush-http-build-cache-plugin/src/test/HttpBuildCacheProvider.test.ts b/rush-plugins/rush-http-build-cache-plugin/src/test/HttpBuildCacheProvider.test.ts index 54f5772979..a86ddb342d 100644 --- a/rush-plugins/rush-http-build-cache-plugin/src/test/HttpBuildCacheProvider.test.ts +++ b/rush-plugins/rush-http-build-cache-plugin/src/test/HttpBuildCacheProvider.test.ts @@ -68,14 +68,14 @@ describe('HttpBuildCacheProvider', () => { ); expect(terminalBuffer.getAllOutputAsChunks({ asLines: true })).toMatchInlineSnapshot(` Array [ - "[ debug] [http-build-cache] request: GET https://buildcache.example.acme.com/some-key unknown bytes", - "[warning] Error getting cache entry: Error: Credentials for https://buildcache.example.acme.com/ have not been provided.", - "[warning] In CI, verify that RUSH_BUILD_CACHE_CREDENTIAL contains a valid Authorization header value.", - "[warning] ", - "[warning] For local developers, run:", - "[warning] ", - "[warning] rush update-cloud-credentials --interactive", - "[warning] ", + "[ debug] [http-build-cache] request: GET https://buildcache.example.acme.com/some-key unknown bytes[n]", + "[warning] Error getting cache entry: Error: Credentials for https://buildcache.example.acme.com/ have not been provided.[n]", + "[warning] In CI, verify that RUSH_BUILD_CACHE_CREDENTIAL contains a valid Authorization header value.[n]", + "[warning] [n]", + "[warning] For local developers, run:[n]", + "[warning] [n]", + "[warning] rush update-cloud-credentials --interactive[n]", + "[warning] [n]", ] `); }); @@ -131,10 +131,10 @@ Array [ ); expect(terminalBuffer.getAllOutputAsChunks({ asLines: true })).toMatchInlineSnapshot(` Array [ - "[ debug] [http-build-cache] request: GET https://buildcache.example.acme.com/some-key unknown bytes", - "[ debug] [http-build-cache] request: GET https://buildcache.example.acme.com/some-key unknown bytes", - "[ debug] [http-build-cache] request: GET https://buildcache.example.acme.com/some-key unknown bytes", - "[warning] Could not get cache entry: HTTP 504: BadGateway", + "[ debug] [http-build-cache] request: GET https://buildcache.example.acme.com/some-key unknown bytes[n]", + "[ debug] [http-build-cache] request: GET https://buildcache.example.acme.com/some-key unknown bytes[n]", + "[ debug] [http-build-cache] request: GET https://buildcache.example.acme.com/some-key unknown bytes[n]", + "[warning] Could not get cache entry: HTTP 504: BadGateway[n]", ] `); }); From 9303b0419bac5d6214faef930871ccbaaea7e3d8 Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Mon, 5 Jan 2026 23:21:58 -0800 Subject: [PATCH 14/14] fixup! Combine sequential logging statements in getAllOutputAsChunks and replace 'asFlat' with 'asLines' --- .../src/StringBufferTerminalProvider.ts | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/libraries/terminal/src/StringBufferTerminalProvider.ts b/libraries/terminal/src/StringBufferTerminalProvider.ts index 0c5c74c525..34eb4d50ca 100644 --- a/libraries/terminal/src/StringBufferTerminalProvider.ts +++ b/libraries/terminal/src/StringBufferTerminalProvider.ts @@ -53,22 +53,24 @@ export interface IOutputChunk { severity: TerminalProviderSeverityName; } -function _normalizeOptions( - options: IStringBufferOutputOptions | undefined -): Required { +function _normalizeOptions( + options: TOptions +): TOptions & Required { return { normalizeSpecialCharacters: true, - - ...(options || {}) + ...options }; } function _normalizeOutput(s: string, options: IStringBufferOutputOptions | undefined): string { - const normalizedOptions: Required = _normalizeOptions(options); + const { normalizeSpecialCharacters } = _normalizeOptions(options ?? {}); + return _normalizeOutputInner(s, normalizeSpecialCharacters); +} +function _normalizeOutputInner(s: string, normalizeSpecialCharacters: boolean): string { s = Text.convertToLf(s); - if (normalizedOptions.normalizeSpecialCharacters) { + if (normalizeSpecialCharacters) { return AnsiEscape.formatForTests(s, { encodeNewlines: true }); } else { return s; @@ -249,8 +251,8 @@ export class StringBufferTerminalProvider implements ITerminalProvider { options: IStringBufferOutputChunksOptions & { asLines: true } ): `[${string}] ${string}`[]; public getAllOutputAsChunks(options: IStringBufferOutputChunksOptions = {}): IOutputChunk[] | string[] { - if (options.asLines) { - const normalizedOptions: Required = _normalizeOptions(options); + const { asLines, normalizeSpecialCharacters } = _normalizeOptions(options); + if (asLines) { const lines: `[${string}] ${string}`[] = []; for (const { text: rawText, severity: rawSeverity } of this._allOutputChunks) { @@ -274,12 +276,11 @@ export class StringBufferTerminalProvider implements ITerminalProvider { const hasNewlineAfter: boolean = i < rawLines.length - 1; // If the original output had a newline after this line, preserve it as the special token - // (e.g. "[-n-]") when normalization is enabled. - const shouldIncludeNewlineToken: boolean = - normalizedOptions.normalizeSpecialCharacters && hasNewlineAfter; + // (e.g. "[n]") when normalization is enabled. + const shouldIncludeNewlineToken: boolean = normalizeSpecialCharacters && hasNewlineAfter; const lineText: string = shouldIncludeNewlineToken ? `${rawLines[i]}\n` : rawLines[i]; - const text: string = _normalizeOutput(lineText, options); + const text: string = _normalizeOutputInner(lineText, normalizeSpecialCharacters); lines.push(`[${severity}] ${text}`); } } @@ -287,7 +288,7 @@ export class StringBufferTerminalProvider implements ITerminalProvider { return lines; } else { return this._allOutputChunks.map(({ text: rawText, severity }) => { - const text: string = _normalizeOutput(rawText, options); + const text: string = _normalizeOutputInner(rawText, normalizeSpecialCharacters); return { text, severity