tests ready
This commit is contained in:
45
frontend/vitest.config.js
Normal file
45
frontend/vitest.config.js
Normal file
@@ -0,0 +1,45 @@
|
||||
import { defineConfig } from 'vitest/config';
|
||||
import { svelte } from '@sveltejs/vite-plugin-svelte';
|
||||
import path from 'path';
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
svelte({
|
||||
test: true
|
||||
})
|
||||
],
|
||||
test: {
|
||||
globals: true,
|
||||
environment: 'jsdom',
|
||||
include: [
|
||||
'src/**/*.{test,spec}.{js,ts}',
|
||||
'src/lib/**/*.test.{js,ts}',
|
||||
'src/lib/**/__tests__/*.test.{js,ts}',
|
||||
'src/lib/**/__tests__/test_*.{js,ts}'
|
||||
],
|
||||
exclude: [
|
||||
'node_modules/**',
|
||||
'dist/**'
|
||||
],
|
||||
coverage: {
|
||||
provider: 'v8',
|
||||
reporter: ['text', 'json', 'html'],
|
||||
include: [
|
||||
'src/lib/stores/**/*.js',
|
||||
'src/lib/components/**/*.svelte'
|
||||
]
|
||||
},
|
||||
setupFiles: ['./src/lib/stores/__tests__/setupTests.js'],
|
||||
alias: [
|
||||
{ find: '$app/environment', replacement: path.resolve(__dirname, './src/lib/stores/__tests__/mocks/environment.js') },
|
||||
{ find: '$app/stores', replacement: path.resolve(__dirname, './src/lib/stores/__tests__/mocks/stores.js') },
|
||||
{ find: '$app/navigation', replacement: path.resolve(__dirname, './src/lib/stores/__tests__/mocks/navigation.js') }
|
||||
]
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'$lib': path.resolve(__dirname, './src/lib'),
|
||||
'$app': path.resolve(__dirname, './src')
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user