Appearance
date: 2026-06-06 tags: [testing, pest, browser, vue, console, vite] status: active graduated_to:
assertNoSmoke() misses console warnings (and prod builds strip Vue's)
Symptom — Wanted browser smoke tests to fail on console errors/warnings (e.g. Vue's "Extraneous non-emits event listeners … PersonaLinkButton" on the Today page), but assertNoSmoke() passes regardless.
Root cause — Two compounding gaps. (1) The plugin's injected init script only overrides console.log and listens for window error events — it captures neither console.warn nor console.error; assertNoSmoke() is just assertNoConsoleLogs() + assertNoJavaScriptErrors(). (2) Browser tests run the vite build (production) bundle, and Vue's dev warnings are gated behind __DEV__ and compiled out of prod builds — so the warning isn't even present to catch.
Fix — To catch warnings: inject a custom init script hooking console.warn + console.error, and build the test bundle in dev mode (vite build --mode development) so Vue emits its warnings. Then assert no errors AND no warnings.
Guard — Epic #250 / Sprint 2 task #272 ("strict console capture"). The PersonaLinkButton warning is itself a real bug — declare the custom listeners in the component's emits.
Shipped — task #317 (Sprint #346) implemented this: a visitStrict() helper in tests/Pest.php injects a second context init script routing console.warn/console.error into the captured-log array assertNoSmoke reads, and composer test:browser now builds a dev-mode bundle (npm run build:test) so Vue emits its warnings. tests/Browser/StrictSmokeTest.php proves both halves.