Files
novalon-website/config/test/jest.config.js
T
张翔 dd2a0999bb
ci/woodpecker/push/woodpecker Pipeline failed
fix: 修复企业微信通知环境变量展开问题
- 使用 PAYLOAD=$(cat <<ENDPAYLOAD) 替代 cat > file <<EOF
- 确保环境变量在 heredoc 中正确展开
- 添加测试脚本验证环境变量展开
- 修复构建详情链接和消息内容缺失问题
2026-03-28 22:48:22 +08:00

41 lines
978 B
JavaScript

module.exports = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
roots: ['<rootDir>/src'],
testMatch: ['**/__tests__/**/*.test.{ts,tsx}', '**/*.test.{ts,tsx}'],
collectCoverageFrom: [
'src/**/*.{ts,tsx}',
'!src/**/*.d.ts',
'!src/**/*.stories.{ts,tsx}',
'!src/**/__tests__/**',
],
coverageThreshold: {
global: {
branches: 80,
functions: 80,
lines: 80,
statements: 80,
},
},
coverageReporters: ['text', 'lcov', 'html', 'json'],
coverageDirectory: 'coverage',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
},
transform: {
'^.+\\.(ts|tsx)$': [
'ts-jest',
{
tsconfig: 'tsconfig.test.json',
},
],
},
transformIgnorePatterns: [
'node_modules/(?!(nanoid|next-auth|@auth)/)',
],
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
testTimeout: 10000,
verbose: true,
maxWorkers: '50%',
};