test: track missing component test configuration
This commit is contained in:
@@ -0,0 +1,29 @@
|
|||||||
|
import { svelte } from '@sveltejs/vite-plugin-svelte';
|
||||||
|
import path from 'node:path';
|
||||||
|
import { defineConfig } from 'vitest/config';
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
plugins: [svelte()],
|
||||||
|
|
||||||
|
test: {
|
||||||
|
environment: 'jsdom',
|
||||||
|
include: ['src/**/*.svelte.test.ts'],
|
||||||
|
exclude: ['node_modules', 'dist', 'e2e', '.storybook'],
|
||||||
|
restoreMocks: true,
|
||||||
|
setupFiles: ['./vitest.setup.component.ts', './vitest.setup.jsdom.ts'],
|
||||||
|
globals: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
resolve: {
|
||||||
|
conditions: ['browser'],
|
||||||
|
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'),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { queryClient } from '$shared/api/queryClient';
|
||||||
import * as matchers from '@testing-library/jest-dom/matchers';
|
import * as matchers from '@testing-library/jest-dom/matchers';
|
||||||
import { cleanup } from '@testing-library/svelte';
|
import { cleanup } from '@testing-library/svelte';
|
||||||
import {
|
import {
|
||||||
@@ -13,6 +14,7 @@ expect.extend(matchers);
|
|||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
cleanup();
|
cleanup();
|
||||||
|
queryClient.clear();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Mock window.matchMedia for components that use it
|
// Mock window.matchMedia for components that use it
|
||||||
|
|||||||
Reference in New Issue
Block a user