Set up Vitest (jsdom environment) and @testing-library/react. api.test.ts — fetchRunningApps: - returns parsed JSON on 2xx - returns [] on non-ok HTTP status - returns [] on network error (non-throwing contract) KnobCard.test.tsx — app_volume: - datalist is rendered with all supplied runningApps as options - no datalist / list attr when runningApps is empty or omitted - onChange called with the new value on input change KnobCard.test.tsx — group_volume: - app-picker select rendered with runningApps options - no picker when runningApps is empty or omitted - Add button disabled until an app is selected - Add button enabled after selection - clicking Add appends app to targets - clicking Add skips duplicates (onChange not called) - picker resets to placeholder after a successful Add
23 lines
432 B
TypeScript
23 lines
432 B
TypeScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
build: {
|
|
outDir: '../src/turnup/ui/static',
|
|
emptyOutDir: true,
|
|
},
|
|
server: {
|
|
port: 5174,
|
|
proxy: {
|
|
'/api': 'http://localhost:5173',
|
|
},
|
|
},
|
|
test: {
|
|
environment: 'jsdom',
|
|
globals: true,
|
|
setupFiles: ['./src/test-setup.ts'],
|
|
},
|
|
})
|