chore(01-01): wire Vitest (happy-dom) and Playwright config + sentinel test

- vitest.config.ts: happy-dom environment (so Plan 03's IndexedDB tests
  can layer fake-indexeddb on top of happy-dom's window per RESEARCH);
  passWithNoTests:false enforces RESEARCH CI Pitfall B (a green CI run
  must mean tests *ran*, not 'no tests existed'); include glob covers
  src/**/*.test.ts(x) and scripts/**/*.test.mjs.
- playwright.config.ts: testDir 'tests/e2e' (not yet created — first spec
  lands in Phase 2 PIPE-07); webServer config wires npm run dev so smoke
  tests can self-start the dev server; baseURL pinned to vite default.
- src/__sentinel__.test.ts: a single test asserting 1+1===2 AND that
  globalThis.window exists, proving the runner is wired and happy-dom is
  active. To be deleted once real tests exist (Plan 03 onward).
- npm test → 1 file, 1 test passed in 593ms.
- npx playwright --version → Version 1.59.1 (matches RESEARCH lock).
This commit is contained in:
2026-05-08 23:18:22 -04:00
parent df7d687da4
commit 7b2982b839
3 changed files with 52 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
import { describe, it, expect } from 'vitest';
// Phase 1 sentinel test.
//
// This test exists purely to prove the test infrastructure is wired:
// - vitest can find and run *.test.ts files,
// - the happy-dom environment is active (so Plan 03 can rely on `window`
// for its IndexedDB-via-fake-indexeddb tests).
//
// Delete this file once real tests exist (Plan 03 onward).
describe('phase-1 test infrastructure sentinel', () => {
it('vitest is wired and the happy-dom environment is active', () => {
expect(1 + 1).toBe(2);
// happy-dom provides `window` in the test env, which save tests will rely on
// for IndexedDB. Assert it exists so Plan 03 can trust the env.
expect(typeof globalThis.window).toBe('object');
});
});