mirror of
https://github.com/EstrellaXD/Auto_Bangumi.git
synced 2026-02-13 23:36:44 +08:00
Backend: - Add API test files for auth, program, downloader, config, log, bangumi extended, search, and passkey endpoints - Update conftest.py with new fixtures (app, authed_client, unauthed_client, mock_program, mock_webauthn, mock_download_client) - Update factories.py with make_config and make_passkey functions Frontend: - Setup vitest testing infrastructure with happy-dom environment - Add test setup file with mocks for axios, router, i18n, localStorage - Add mock API data for testing - Add tests for API logic, store logic, hooks, and basic components - Add @vue/test-utils and happy-dom dev dependencies Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
39 lines
875 B
TypeScript
39 lines
875 B
TypeScript
import { resolve } from 'node:path';
|
|
import { defineConfig } from 'vitest/config';
|
|
import vue from '@vitejs/plugin-vue';
|
|
import AutoImport from 'unplugin-auto-import/vite';
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
vue(),
|
|
AutoImport({
|
|
imports: ['vue', 'vitest', 'pinia'],
|
|
dts: false,
|
|
}),
|
|
],
|
|
test: {
|
|
environment: 'happy-dom',
|
|
globals: true,
|
|
setupFiles: ['./src/test/setup.ts'],
|
|
include: ['src/**/*.{test,spec}.{js,ts}'],
|
|
coverage: {
|
|
provider: 'v8',
|
|
reporter: ['text', 'json', 'html'],
|
|
include: ['src/**/*.{ts,vue}'],
|
|
exclude: [
|
|
'src/test/**',
|
|
'src/**/*.d.ts',
|
|
'src/main.ts',
|
|
'src/router/**',
|
|
],
|
|
},
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'~': resolve(__dirname, './'),
|
|
'@': resolve(__dirname, 'src'),
|
|
'#': resolve(__dirname, 'types'),
|
|
},
|
|
},
|
|
});
|