chore(web): add Vitest; add dayCapabilities helper with full test coverage
- Install vitest + jsdom - Add test/test:watch scripts to package.json - Add test:web and test:all tasks to mise.toml - Add dayCapabilities() to utils.ts — single source of truth for what actions are permitted per day (future/today/past, open/closed) - Add DayCapabilities interface to utils.ts - 11 unit tests: dayCapabilities (5 cases), weekDayKeys (3 cases), isWorkday (3 cases)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { sveltekit } from '@sveltejs/kit/vite';
|
||||
import { defineConfig } from 'vite';
|
||||
import { defineConfig } from 'vitest/config';
|
||||
import { VitePWA } from 'vite-plugin-pwa';
|
||||
|
||||
export default defineConfig({
|
||||
@@ -45,5 +45,10 @@ export default defineConfig({
|
||||
'/api': 'http://localhost:8080',
|
||||
'/healthz': 'http://localhost:8080'
|
||||
}
|
||||
},
|
||||
test: {
|
||||
environment: 'jsdom',
|
||||
globals: true,
|
||||
include: ['src/**/*.test.ts']
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user