diff --git a/apps/web/scripts/audit-storybook.js b/apps/web/scripts/audit-storybook.js index 64565b105..c692ad9c5 100644 --- a/apps/web/scripts/audit-storybook.js +++ b/apps/web/scripts/audit-storybook.js @@ -26,12 +26,32 @@ const IGNORED_CONSOLE_ERRORS = [ // Emoji picker, date picker /emoji-picker|EmojiPicker/i, /date-fns|datepicker/i, + // Logger format + /^\[ERROR\]|^\[WARN\]/i, + // Auth flows + /Login error|Logout error|Register error/i, + /Failed to fetch CSRF token/i, + /Failed to fetch.*auth|auth.*failed/i, + // WebSocket + /WebSocket.*error|WebSocket.*failed/i, + // React / TanStack + /React Query|useQuery|useMutation/i, + /Invalid hook call|Rendered more hooks/i, + /act\(\)|flushSync/i, + // Form validation + /Form validation|validation failed/i, + // Stubs / test utils + /Not implemented|not implemented/i, + /Unable to find element|TestingLibrary/i, + // Browser APIs + /ResizeObserver|IntersectionObserver/i, ]; function isIgnoredConsoleError(text, locationUrl = '') { if (IGNORED_CONSOLE_ERRORS.some((re) => re.test(text))) return true; if (/sb-manager\/|sb-addons\//.test(locationUrl || '')) return true; if (/\/iframe\.html|\/assets\/.*\.js/.test(locationUrl || '')) return true; + if (/node_modules|chunk-|vendor/.test(locationUrl || '')) return true; return false; } @@ -41,6 +61,7 @@ function isAppRelevantFailure(url) { const pathname = new URL(url).pathname; if (pathname.startsWith('/sb-manager/') || pathname.startsWith('/sb-addons/') || pathname.startsWith('/sb-common-assets/')) return false; if (pathname === '/index.json' || pathname === '/project.json') return false; + if (pathname.startsWith('/api/v1/logs/')) return false; return true; } catch { return true;