Skip to content

Commit f30a384

Browse files
committed
test: npm test script to not do coverage
The npm test script shouldn't include coverage by default, that should itself be a separate command. In most cases you would locally run tests normally without coverage in majority of the cases Instead I added a new npm script test:coverage that includes coverage, and changed npm script test to be --watch by default
1 parent ff93b85 commit f30a384

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ npm run build
2727
# Run the test suite
2828
npm run test
2929

30+
# Run the test suite with coverage
31+
npm run test:coverage
32+
3033
# Run the linter
3134
npm run lint
3235

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module.exports = {
66
clearMocks: true,
77

88
// Indicates whether the coverage information should be collected while executing the test
9-
collectCoverage: true,
9+
collectCoverage: false,
1010

1111
// The directory where Jest should output its coverage files
1212
coverageDirectory: 'coverage',

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@
1212
"build": "webpack --config webpack.prod.js && npm run dr:surge",
1313
"start": "sirv dist --cors --single --host --port 8080",
1414
"start:dev": "webpack serve --hot --color --progress --config webpack.dev.js",
15-
"test": "jest",
15+
"test": "jest --watch",
16+
"test:coverage": "jest --coverage",
1617
"eslint": "eslint --ext .tsx,.js ./src/",
1718
"lint": "npm run eslint",
1819
"format": "prettier --check --write ./src/**/*.{tsx,ts}",
1920
"type-check": "tsc --noEmit",
20-
"ci-checks": "npm run type-check && npm run lint && npm run test",
21+
"ci-checks": "npm run type-check && npm run lint && npm run test:coverage",
2122
"build:bundle-profile": "webpack --config webpack.prod.js --profile --json > stats.json",
2223
"bundle-profile:analyze": "npm run build:bundle-profile && webpack-bundle-analyzer ./stats.json",
2324
"clean": "rimraf dist",

src/app/Dashboard/Dashboard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { PageSection, Title } from '@patternfly/react-core';
33

44
const Dashboard: React.FunctionComponent = () => (
55
<PageSection>
6-
<Title headingLevel="h1" size="lg">Dashboard Page Title</Title>
6+
<Title headingLevel="h1" size="lg">Dashboard Page Title!</Title>
77
</PageSection>
88
)
99

0 commit comments

Comments
 (0)