diff --git a/tsconfig.json b/tsconfig.json index 61b2cfaf..7061561e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,9 +12,10 @@ "experimentalDecorators": true, "esModuleInterop": true, "noUnusedLocals": true, - "moduleResolution": "node", + "moduleResolution": "Bundler", "declaration": true, "resolveJsonModule": true, + "types": ["vitest/globals"], // TODO: Enable the following options later. // "forceConsistentCasingInFileNames": true, diff --git a/vitest.config.js b/vitest.config.js new file mode 100644 index 00000000..45ac399a --- /dev/null +++ b/vitest.config.js @@ -0,0 +1,31 @@ +import { defineConfig, mergeConfig } from 'vitest/config' +import viteConfig from './vite.config' + +export default defineConfig(configEnv => mergeConfig( + viteConfig(configEnv), + defineConfig({ + test: { + globals: true, + environment: 'jsdom', + alias: { + "\\.css$": "identity-obj-proxy", + "\\.svg\\?react$": "/test/mocks/svgr.ts", + "^\\./IndexedDBWorker\\?worker$": "/test/mocks/workerMock.ts", + "^\\./olm$": "/test/mocks/olmMock.ts" + }, + css: { + modules: { + classNameStrategy: 'non-scoped' + } + }, + include: [ + "test/**/*-test.[jt]s?(x)" + ], + coverage: { + reporter: ['text', 'html'], + exclude: [ + 'node_modules/' + ] + } + } +}))) \ No newline at end of file