mirror of
https://github.com/wuzf/2fa.git
synced 2026-09-02 22:43:52 +08:00
- Refactor monolithic worker into layered modules (api, otp, ui, utils) - Add Vitest test suite with 598 tests across 17 files - Set up GitHub Actions CI/CD, Dependabot - Add community files (CONTRIBUTING, CODE_OF_CONDUCT, SECURITY, templates) - Add comprehensive documentation (API reference, architecture, deployment) - Configure ESLint, Prettier, and Husky pre-commit hooks - Implement PWA frontend with modular scripts, styles, and service worker
23 lines
592 B
JavaScript
23 lines
592 B
JavaScript
import { defineConfig } from 'vitest/config';
|
|
|
|
export default defineConfig({
|
|
test: {
|
|
globals: true,
|
|
environment: 'node',
|
|
setupFiles: ['./tests/setup.js'], // 加载测试环境设置
|
|
include: ['tests/**/*.test.js', 'src/**/*.test.js'],
|
|
coverage: {
|
|
provider: 'v8',
|
|
reporter: ['text', 'json', 'html'],
|
|
include: ['src/**/*.js'],
|
|
exclude: [
|
|
'src/ui/**', // 前端代码单独测试
|
|
'src/worker.js', // Worker 入口需要集成测试
|
|
'src/**/*.test.js'
|
|
]
|
|
},
|
|
testTimeout: 10000,
|
|
hookTimeout: 10000
|
|
}
|
|
});
|