Skip to content

Commit 83d6f44

Browse files
committed
add test coverage setup
1 parent aaa6aeb commit 83d6f44

File tree

4 files changed

+708
-9
lines changed

4 files changed

+708
-9
lines changed

.prettierignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
!/.eslintrc.json
1616
!/tsconfig*.json
1717
!/*.config.{js,ts}
18-
!/jest.setup.ts
18+
!/jest.setup.ts

jest.config.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,21 @@ const createJestConfig = nextJest({
55
});
66

77
const customJestConfig = {
8-
collectCoverage: false,
9-
collectCoverageFrom: ['tests'],
10-
coverageDirectory: './.meta',
11-
coverageReporters: ['json-summary'],
8+
collectCoverage: true,
9+
collectCoverageFrom: ['./src/ui/**/*.{ts,tsx}'],
10+
coverageDirectory: './coverage',
11+
coverageProvider: 'v8',
12+
coverageReporters: ['json', 'text-summary', 'lcov'],
1213
moduleFileExtensions: ['ts', 'tsx', 'js'],
1314
moduleNameMapper: {
1415
'^@/(.*)$': '<rootDir>/$1',
1516
},
1617
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
1718
testEnvironment: 'jest-environment-jsdom',
19+
testMatch: [
20+
'<rootDir>/tests/ui/unit/**/*.(test|spec).{ts,tsx,js,jsx}',
21+
'<rootDir>/tests/ui/integration/**/*.(test|spec).{ts,tsx,js,jsx}',
22+
],
1823
};
1924

2025
module.exports = createJestConfig(customJestConfig);

0 commit comments

Comments
 (0)