diff --git a/client-svelte/src/lib/DisplayTodoItem.test.ts b/client-svelte/src/lib/DisplayTodoItem.test.ts index 0fc4f34..5abb39d 100644 --- a/client-svelte/src/lib/DisplayTodoItem.test.ts +++ b/client-svelte/src/lib/DisplayTodoItem.test.ts @@ -1,4 +1,3 @@ -import '@testing-library/jest-dom' import { describe, it, expect, afterEach, vi } from 'vitest' import { render, fireEvent, screen } from '@testing-library/svelte' diff --git a/client-svelte/tsconfig.json b/client-svelte/tsconfig.json index d310f9c..a4dbb70 100644 --- a/client-svelte/tsconfig.json +++ b/client-svelte/tsconfig.json @@ -14,6 +14,7 @@ "allowJs": true, "checkJs": true, "isolatedModules": true, + "types": ["@testing-library/jest-dom"] }, "include": ["src/**/*.ts", "src/**/*.js", "src/**/*.svelte"], "references": [{ "path": "./tsconfig.node.json" }] diff --git a/client-svelte/tsconfig.node.json b/client-svelte/tsconfig.node.json index 9caf126..548af5e 100644 --- a/client-svelte/tsconfig.node.json +++ b/client-svelte/tsconfig.node.json @@ -4,7 +4,6 @@ "skipLibCheck": true, "module": "ESNext", "moduleResolution": "bundler", - "types": ["vitest/global"] }, "include": ["vite.config.ts"] } diff --git a/client-svelte/vite.config.ts b/client-svelte/vite.config.ts index 70b83f9..09450e6 100644 --- a/client-svelte/vite.config.ts +++ b/client-svelte/vite.config.ts @@ -8,5 +8,5 @@ export default defineConfig({ proxy: { '/api': 'http://localhost:4400' } - } + }, }) diff --git a/client-svelte/vitest.config.ts b/client-svelte/vitest.config.ts index 372d19b..1d84ec4 100644 --- a/client-svelte/vitest.config.ts +++ b/client-svelte/vitest.config.ts @@ -6,5 +6,7 @@ export default defineConfig({ test: { globals: true, environment: 'jsdom', - }, + alias: [{ find: /^svelte$/, replacement: 'svelte/internal' }], + setupFiles: ['./vitest-setup.ts'] + } }) \ No newline at end of file