test: fix import assertion (#19260)

This commit is contained in:
Alexander Akait 2025-02-27 18:43:07 +03:00 committed by GitHub
parent 564a0e52a0
commit 0377fb1643
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 4 deletions

View File

@ -17,10 +17,16 @@ module.exports = (stdio, tty) => {
reset: () => (logs = []),
toString: () =>
stripAnsi(logs.join("")).replace(
/\([^)]+\) (\[[^\]]+\]\s*)?(Deprecation|Experimental)Warning.+(\n\(Use .node.+\))?(\n(\s|BREAKING CHANGE).*)*(\n\s+at .*)*\n?/g,
""
),
stripAnsi(logs.join(""))
.replace(
/\([^)]+\) (\[[^\]]+\]\s*)?(Deprecation|Experimental)Warning.+(\n\(Use .node.+\))?(\n(\s|BREAKING CHANGE).*)*(\n\s+at .*)*\n?/g,
""
)
// Ignore deprecated `import * as pkg from "file.json" assert { type: "json" };`
.replace(
/\([^)]+\) (\[[^\]]+\]\s*)?(V8:).* 'assert' is deprecated in import statements and support will be removed in a future version; use 'with' instead\n/g,
""
),
toStringRaw: () => logs.join(""),