Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ui/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,

/* Test runtime types */
"types": ["node", "vitest/globals", "@testing-library/jest-dom"],

/* Path mapping */
"baseUrl": ".",
"paths": {
Expand Down
6 changes: 6 additions & 0 deletions ui/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
/// <reference types="vitest" />

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reference Vitest config types in Vite config

The triple-slash directive should point to vitest/config, not vitest: /// <reference types="vitest" /> does not add the test field augmentation to Vite's UserConfig. Since ui/tsconfig.node.json includes vite.config.ts, project-reference type checks (for example tsc -b or IDE validation of config files) can fail with 'test' does not exist in type 'UserConfig', even though this file now relies on that property.

Useful? React with 👍 / 👎.

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
test: {
globals: true,
environment: 'jsdom',
setupFiles: ['./src/test/setup.ts'],
},
server: {
port: 3000,
proxy: {
Expand Down
Loading