From cfdb4d9db1869b5d222ee9159220175372ef127d Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Wed, 19 Nov 2025 15:12:13 +0100 Subject: [PATCH 1/4] chore: add node 25 to CI --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c3d86a4613f2..6146c4f30f3b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - node-version: [18.x, 20.x, 22.x, 24.x] + node-version: [18.x, 20.x, 22.x, 24.x, 25.x] name: Node v${{ matrix.node-version }} runs-on: ${{ inputs.os }} From cb6902c1f4b9118bc0c9858e00298a0da1b343c8 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Thu, 20 Nov 2025 09:22:58 +0100 Subject: [PATCH 2/4] try to strip out warning --- e2e/runJest.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/e2e/runJest.ts b/e2e/runJest.ts index 651ba2550d2b..aa23836a8c18 100644 --- a/e2e/runJest.ts +++ b/e2e/runJest.ts @@ -123,6 +123,14 @@ export interface RunJestJsonResult extends RunJestResult { json: FormattedTestResults; } +const nodeNumberWarning = /\(node:\d+\) Warning: `--localstorage-file`/g; +const nodeNumberReplacement = '(node: line) Warning: `--localstorage-file`'; + +const localStorageWarning = + `${nodeNumberReplacement} was provided without a valid path\n` + + '(Use `node --trace-warnings ...` to show where the warning was created)'; +const localStorageWarningWithNewlines = `\n\n${localStorageWarning}`; + function normalizeStreamString( stream: string, options: RunJestOptions, @@ -130,6 +138,10 @@ function normalizeStreamString( if (options.stripAnsi) stream = stripAnsi(stream); stream = normalizeIcons(stream); + stream = stream.replaceAll(nodeNumberWarning, nodeNumberReplacement); + stream = stream.replaceAll(localStorageWarningWithNewlines, ''); + stream = stream.replaceAll(localStorageWarning, ''); + return stream; } From d6d9b048e7237569bf7d19ade24cffba5718937e Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Thu, 20 Nov 2025 09:27:39 +0100 Subject: [PATCH 3/4] stick in helper --- e2e/runJest.ts | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/e2e/runJest.ts b/e2e/runJest.ts index aa23836a8c18..5a51ce25f6a8 100644 --- a/e2e/runJest.ts +++ b/e2e/runJest.ts @@ -123,13 +123,21 @@ export interface RunJestJsonResult extends RunJestResult { json: FormattedTestResults; } -const nodeNumberWarning = /\(node:\d+\) Warning: `--localstorage-file`/g; -const nodeNumberReplacement = '(node: line) Warning: `--localstorage-file`'; - -const localStorageWarning = - `${nodeNumberReplacement} was provided without a valid path\n` + - '(Use `node --trace-warnings ...` to show where the warning was created)'; -const localStorageWarningWithNewlines = `\n\n${localStorageWarning}`; +// https://github.com/nodejs/node/issues/60704 +function removeLocalStorageWarning(stream: string): string { + const nodeNumberWarning = /\(node:\d+\) Warning: `--localstorage-file`/g; + const nodeNumberReplacement = '(node: line) Warning: `--localstorage-file`'; + + const localStorageWarning = + `${nodeNumberReplacement} was provided without a valid path\n` + + '(Use `node --trace-warnings ...` to show where the warning was created)'; + const localStorageWarningWithNewlines = `\n\n${localStorageWarning}`; + + return stream + .replaceAll(nodeNumberWarning, nodeNumberReplacement) + .replaceAll(localStorageWarningWithNewlines, '') + .replaceAll(localStorageWarning, ''); +} function normalizeStreamString( stream: string, @@ -137,10 +145,7 @@ function normalizeStreamString( ): string { if (options.stripAnsi) stream = stripAnsi(stream); stream = normalizeIcons(stream); - - stream = stream.replaceAll(nodeNumberWarning, nodeNumberReplacement); - stream = stream.replaceAll(localStorageWarningWithNewlines, ''); - stream = stream.replaceAll(localStorageWarning, ''); + stream = removeLocalStorageWarning(stream); return stream; } From 3b1869f629b0cc5254ef3439d37f3b2e32ebc23b Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Thu, 20 Nov 2025 09:39:55 +0100 Subject: [PATCH 4/4] also trailing newline --- e2e/runJest.ts | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/e2e/runJest.ts b/e2e/runJest.ts index 5a51ce25f6a8..442d1cca01e4 100644 --- a/e2e/runJest.ts +++ b/e2e/runJest.ts @@ -124,18 +124,23 @@ export interface RunJestJsonResult extends RunJestResult { } // https://github.com/nodejs/node/issues/60704 -function removeLocalStorageWarning(stream: string): string { +function removeLocalStorageWarning(string: string): string { const nodeNumberWarning = /\(node:\d+\) Warning: `--localstorage-file`/g; const nodeNumberReplacement = '(node: line) Warning: `--localstorage-file`'; const localStorageWarning = `${nodeNumberReplacement} was provided without a valid path\n` + '(Use `node --trace-warnings ...` to show where the warning was created)'; - const localStorageWarningWithNewlines = `\n\n${localStorageWarning}`; + const localStorageWarningWithLeadingNewline = `\n${localStorageWarning}`; + const localStorageWarningWithLeadingNewlines = `\n${localStorageWarningWithLeadingNewline}`; - return stream + return string .replaceAll(nodeNumberWarning, nodeNumberReplacement) - .replaceAll(localStorageWarningWithNewlines, '') + .replaceAll(`${localStorageWarningWithLeadingNewlines}\n`, '') + .replaceAll(localStorageWarningWithLeadingNewlines, '') + .replaceAll(`${localStorageWarningWithLeadingNewline}\n`, '') + .replaceAll(localStorageWarningWithLeadingNewline, '') + .replaceAll(`${localStorageWarning}\n`, '') .replaceAll(localStorageWarning, ''); } @@ -143,6 +148,10 @@ function normalizeStreamString( stream: string, options: RunJestOptions, ): string { + if (stream.length === 0) { + return ''; + } + if (options.stripAnsi) stream = stripAnsi(stream); stream = normalizeIcons(stream); stream = removeLocalStorageWarning(stream);