feat: set up vitest browser config for svelte components tests
This commit is contained in:
31
vitest.config.browser.ts
Normal file
31
vitest.config.browser.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { svelte } from '@sveltejs/vite-plugin-svelte';
|
||||
import { playwright } from '@vitest/browser-playwright';
|
||||
import path from 'node:path';
|
||||
import { defineConfig } from 'vitest/config';
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [svelte()],
|
||||
|
||||
test: {
|
||||
browser: {
|
||||
enabled: true,
|
||||
provider: playwright({}),
|
||||
instances: [{ browser: 'chromium' }],
|
||||
},
|
||||
include: ['src/**/*.svelte.test.ts'],
|
||||
setupFiles: ['./vitest.setup.component.ts'],
|
||||
globals: true,
|
||||
},
|
||||
|
||||
resolve: {
|
||||
alias: {
|
||||
$lib: path.resolve(__dirname, './src/lib'),
|
||||
$app: path.resolve(__dirname, './src/app'),
|
||||
$shared: path.resolve(__dirname, './src/shared'),
|
||||
$entities: path.resolve(__dirname, './src/entities'),
|
||||
$features: path.resolve(__dirname, './src/features'),
|
||||
$routes: path.resolve(__dirname, './src/routes'),
|
||||
$widgets: path.resolve(__dirname, './src/widgets'),
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user