tests ready

This commit is contained in:
2026-02-19 13:33:20 +03:00
parent c8b84b7bd7
commit 2c820e103a
17 changed files with 2618 additions and 65 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -6,17 +6,23 @@
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
"preview": "vite preview",
"test": "vitest run",
"test:watch": "vitest"
},
"devDependencies": {
"@sveltejs/adapter-static": "^3.0.10",
"@sveltejs/kit": "^2.49.2",
"@sveltejs/vite-plugin-svelte": "^6.2.1",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/svelte": "^5.3.1",
"autoprefixer": "^10.4.0",
"jsdom": "^28.1.0",
"postcss": "^8.4.0",
"svelte": "^5.43.8",
"tailwindcss": "^3.0.0",
"vite": "^7.2.4"
"vite": "^7.2.4",
"vitest": "^4.0.18"
},
"dependencies": {
"date-fns": "^4.1.0"

View File

@@ -18,9 +18,8 @@
/**
* @PURPOSE Component properties and state.
* @PRE taskId is a valid string, logs is an array of LogEntry objects.
* @PRE logs is an array of LogEntry objects.
*/
export let taskId = "";
export let logs = [];
export let autoScroll = true;

45
frontend/vitest.config.js Normal file
View 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')
}
}
});