Mirrors apps/portal's Vitest setup so the SPA can take frontend unit + component tests. Required prerequisite for WS-6 sessie 3b's admin UI work — apps/portal had 113+ tests, apps/app had zero, and launching WS-6's organizer UI uncovered while the portal SPA is well-tested would be asymmetric quality. Setup: - vitest, happy-dom, @vue/test-utils, @testing-library/vue installed - vitest.config.ts mirrors portal config: trimmed auto-imports (no pinia/vue-router/vue-i18n/@vueuse/math) so tests run fast in happy-dom without loading the full Vuexy bundle - AutoImport's dts:false prevents the trimmed test-only set from clobbering the dev-server's full auto-imports.d.ts (apps/app's auto-import surface is bigger than the portal's) - tests/setup.ts mocks vue-router by default; tests that exercise the real router can override per-suite - Sample sanity test confirms the harness works end-to-end Adds `pnpm test` and `pnpm test:watch` scripts to package.json. Refs: BACKLOG TECH-APP-VITEST, WS-6 sessie 3b prerequisite Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
20 lines
542 B
TypeScript
20 lines
542 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
|
|
/**
|
|
* Harness sanity check — confirms Vitest + happy-dom + auto-imports
|
|
* are wired correctly. If this passes, real tests under
|
|
* src/**\/__tests__/ can run without per-suite plumbing.
|
|
*
|
|
* Tracked: BACKLOG TECH-APP-VITEST closed by WS-6 sessie 3b.
|
|
*/
|
|
describe('vitest harness', () => {
|
|
it('runs in happy-dom with globals', () => {
|
|
expect(typeof window).toBe('object')
|
|
expect(typeof document).toBe('object')
|
|
})
|
|
|
|
it('truth holds', () => {
|
|
expect(true).toBe(true)
|
|
})
|
|
})
|