Unverified 提交 7406ef9c authored 作者: Will Chen's avatar Will Chen 提交者: GitHub

Suppress noisy stderr output in test suite (#2665)

## Summary - Add `onConsoleLog` handler in vitest config to suppress all console output from tests (retry logs, settings errors, processor warnings) - Set `NODE_OPTIONS=--no-deprecation` to suppress punycode `DEP0040` warnings from vitest worker processes - Set `VITE_CJS_IGNORE_WARNING=true` to suppress Vite CJS API deprecation warning #skip-bugbot ## Test plan - Run `npm test` and verify clean output with no stderr noise - Verify all 810 tests still pass 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- devin-review-badge-begin --> --- <a href="https://app.devin.ai/review/dyad-sh/dyad/pull/2665" target="_blank"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1"> <img src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1" alt="Open with Devin"> </picture> </a> <!-- devin-review-badge-end --> --------- Co-authored-by: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
上级 54c7f385
...@@ -33,9 +33,9 @@ ...@@ -33,9 +33,9 @@
"fmt:check": "npx oxfmt --check", "fmt:check": "npx oxfmt --check",
"fmt": "npx oxfmt", "fmt": "npx oxfmt",
"presubmit": "npm run fmt:check && npm run lint", "presubmit": "npm run fmt:check && npm run lint",
"test": "vitest run", "test": "cross-env NODE_OPTIONS=--no-deprecation VITE_CJS_IGNORE_WARNING=true vitest run",
"test:watch": "vitest", "test:watch": "cross-env NODE_OPTIONS=--no-deprecation VITE_CJS_IGNORE_WARNING=true vitest",
"test:ui": "vitest --ui", "test:ui": "cross-env NODE_OPTIONS=--no-deprecation VITE_CJS_IGNORE_WARNING=true vitest --ui",
"extract-codebase": "ts-node scripts/extract-codebase.ts", "extract-codebase": "ts-node scripts/extract-codebase.ts",
"init-precommit": "husky", "init-precommit": "husky",
"build": "npm run pre:e2e", "build": "npm run pre:e2e",
......
...@@ -8,6 +8,28 @@ export default defineConfig({ ...@@ -8,6 +8,28 @@ export default defineConfig({
environment: "happy-dom", environment: "happy-dom",
include: ["src/**/*.{test,spec}.{ts,tsx}"], include: ["src/**/*.{test,spec}.{ts,tsx}"],
globals: true, globals: true,
onConsoleLog(log, _type) {
// Suppress known noisy logs while allowing useful debugging output
const noisyPatterns = [
// Retry/flakiness logs from test utilities
/retry.*attempt/i,
/retrying/i,
// Settings-related noise during test setup
/failed to.*settings/i,
/settings.*error/i,
// Processor warnings that don't indicate real issues
/processor.*warning/i,
// Known test fixture console outputs (not real errors)
/\[test\]/i,
];
for (const pattern of noisyPatterns) {
if (pattern.test(log)) {
return false;
}
}
// Allow all other console output (including errors) for debugging
},
}, },
resolve: { resolve: {
alias: { alias: {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论