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 }} diff --git a/e2e/runJest.ts b/e2e/runJest.ts index 651ba2550d2b..442d1cca01e4 100644 --- a/e2e/runJest.ts +++ b/e2e/runJest.ts @@ -123,12 +123,38 @@ export interface RunJestJsonResult extends RunJestResult { json: FormattedTestResults; } +// https://github.com/nodejs/node/issues/60704 +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 localStorageWarningWithLeadingNewline = `\n${localStorageWarning}`; + const localStorageWarningWithLeadingNewlines = `\n${localStorageWarningWithLeadingNewline}`; + + return string + .replaceAll(nodeNumberWarning, nodeNumberReplacement) + .replaceAll(`${localStorageWarningWithLeadingNewlines}\n`, '') + .replaceAll(localStorageWarningWithLeadingNewlines, '') + .replaceAll(`${localStorageWarningWithLeadingNewline}\n`, '') + .replaceAll(localStorageWarningWithLeadingNewline, '') + .replaceAll(`${localStorageWarning}\n`, '') + .replaceAll(localStorageWarning, ''); +} + function normalizeStreamString( stream: string, options: RunJestOptions, ): string { + if (stream.length === 0) { + return ''; + } + if (options.stripAnsi) stream = stripAnsi(stream); stream = normalizeIcons(stream); + stream = removeLocalStorageWarning(stream); return stream; }