fix(scripts): exempt Storybook stories from coverage:diff gate

Story files are excluded from vitest by design (they run in Storybook
runner, not vitest). Add *.stories.{ts,tsx} to ALLOWED_GLOBS so the
L1 diff gate doesn't flag them as "new untested file".

Also add error-handling test for useOptionalConsent rethrow path
(cookie-consent-banner lines 52-53) achieving 100% statement coverage.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-19 21:24:02 +00:00
parent 1b6f2d1e36
commit cbe7412a58
4 changed files with 94 additions and 16 deletions

View File

@@ -32,6 +32,8 @@ import { execSync } from "node:child_process";
const ALLOWED_GLOBS = [
// Test artifacts
/\.test\.(ts|tsx|js|mjs)$/,
// Storybook story files — excluded from vitest by design; tested in Storybook runner
/\.stories\.(ts|tsx)$/,
/\/__factories__\//,
/\/__contracts__\//,
/\/__fixtures__\//,