Skip to content

Commit

Permalink
chore: 🤖 enable code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
nbentoneves committed Jun 17, 2022
1 parent 06424ac commit 92f4f6c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ bower_components
psd
thumb
sketch
coverage

### VisualStudioCode ###
.vscode/*
Expand Down
16 changes: 15 additions & 1 deletion craco.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,26 @@ module.exports = {
jestConfig.roots = ["."];
jestConfig.setupFilesAfterEnv = ["./src/setupTests.ts"];
jestConfig.testMatch = ["**/__tests__/**/*.{js,jsx,ts,tsx}", "**/*.{spec,test}.{js,jsx,ts,tsx}"];
jestConfig.coverageThreshold = {
"global": {
"branches": 70,
"functions": 90,
"lines": 90,
"statements": 90
}
};
jestConfig.collectCoverageFrom = [
"src/**/*.{js,jsx,ts,tsx}",
"!src/testing/*",
"!src/**/*.cypress.{ts,tsx}",
"!src/**/*.d.ts",
];
jestConfig.projects =
[
{
"displayName": "Unit",
"testPathIgnorePatterns": ["/node_modules/", "/e2e/"],
"testMatch": ['<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}', '<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}']
"testMatch": ['<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}', '<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}'],
},
{
"displayName": "E2E",
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"scripts": {
"start": "craco start ",
"build": "craco build",
"test:unit": "DEBUG_PRINT_LIMIT=10000 craco test --silent --selectProjects Unit",
"test:unit": "DEBUG_PRINT_LIMIT=10000 craco test --coverage --silent --selectProjects Unit --watchAll=false",
"test:unit-watch": "yarn test:unit --watchAll=true",
"test:pre-e2e": "concurrently -n chromedriver,mock-server \"yarn run:chromedriver\" \"yarn run:mock-server &> /dev/null 2>&1\"",
"test:e2e": "DEBUG_PRINT_LIMIT=10000 craco test --selectProjects=E2E --testTimeout=300000 --watchAll=false",
"cypress:open": "cypress open --component",
Expand Down

0 comments on commit 92f4f6c

Please sign in to comment.