chore: configure jest coverage
This commit is contained in:
@@ -1,36 +0,0 @@
|
||||
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: 35,
|
||||
functions: 45,
|
||||
lines: 45,
|
||||
statements: 45,
|
||||
},
|
||||
},
|
||||
coverageReporters: ['text', 'lcov', 'html', 'json'],
|
||||
coverageDirectory: 'coverage',
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
|
||||
moduleNameMapper: {
|
||||
'^@/(.*)$': '<rootDir>/src/$1',
|
||||
},
|
||||
transform: {
|
||||
'^.+\\.(ts|tsx)$': 'ts-jest',
|
||||
},
|
||||
transformIgnorePatterns: [
|
||||
'node_modules/(?!(nanoid|next-auth|@auth)/)',
|
||||
],
|
||||
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
|
||||
testTimeout: 10000,
|
||||
verbose: true,
|
||||
maxWorkers: '50%',
|
||||
};
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
config/test/jest.config.js
|
||||
+3
-1
@@ -12,6 +12,7 @@
|
||||
"test:unit": "jest",
|
||||
"test:coverage": "jest --coverage",
|
||||
"test:coverage:check": "jest --coverage --ci",
|
||||
"coverage:report": "open coverage/lcov-report/index.html",
|
||||
"test:e2e": "cd e2e && npm test",
|
||||
"test:smoke": "cd e2e && npx playwright test --grep @smoke",
|
||||
"test:tier:fast": "cd e2e && TEST_TIER=fast npx playwright test --config=playwright.config.tiered.ts",
|
||||
@@ -45,7 +46,8 @@
|
||||
"lighthouse:assert": "lhci assert",
|
||||
"lighthouse:upload": "lhci upload",
|
||||
"lighthouse:desktop": "lhci autorun --settings.preset=desktop",
|
||||
"lighthouse:mobile": "lhci autorun --settings.preset=mobile"
|
||||
"lighthouse:mobile": "lhci autorun --settings.preset=mobile",
|
||||
"prepare": "husky"
|
||||
},
|
||||
"dependencies": {
|
||||
"@antv/g2": "^5.4.8",
|
||||
|
||||
Reference in New Issue
Block a user