Skip to content

Commit 2dc7725

Browse files
committed
update jest config and npm scripts
1 parent 3e52365 commit 2dc7725

File tree

7 files changed

+36
-16
lines changed

7 files changed

+36
-16
lines changed

.eslintignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# don't ever lint node_modules
2+
node_modules
3+
# don't lint build output (make sure it's set to your correct build folder name)
4+
dist
5+
# don't lint nyc coverage output
6+
coverage
7+
jest.config.js

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module.exports = {
2+
root: true,
23
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
34
plugins: ['react-hooks', 'jest', 'prettier'],
45
extends: [

.github/workflows/unit-tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,3 @@ jobs:
5353
CC_TEST_REPORTER_ID: 42e3a64ee207907b6046792e75806574459a65fe54ddcd734ba2bbc1f777700e
5454
with:
5555
coverageCommand: npm run test:coverage
56-
debug: true

jest.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
preset: 'ts-jest',
3+
cache: false,
4+
coverageReporters: ['lcov', 'text', 'html'],
5+
coverageDirectory: './coverage',
6+
};

jestconfig.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

package-lock.json

Lines changed: 14 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,15 @@
88
"lib/**/*"
99
],
1010
"scripts": {
11-
"test": "jest --config jestconfig.json",
11+
"clean:coverage": "rimraf coverage/*",
12+
"clean:build": "rimraf lib/*",
13+
"pretest": "npm rum clean:coverage",
14+
"test": "jest",
15+
"pretest:coverage": "npm rum clean:coverage",
16+
"test:coverage": "jest --coverage",
1217
"pretest:coverage_publish": "[ ! -x cc-test-reporter ] && ( curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter && chmod +x ./cc-test-reporter && ./cc-test-reporter before-build ) || true",
13-
"test:coverage": "jest --coverage --config jestconfig.json",
1418
"test:coverage_publish": "CC_TEST_REPORTER_ID=42e3a64ee207907b6046792e75806574459a65fe54ddcd734ba2bbc1f777700e ./cc-test-reporter after-build -t lcov --debug",
15-
"prebuild": "[ -d lib ] && rm -rfv lib/* || true",
19+
"prebuild": "npm run clean:build",
1620
"build": "tsc",
1721
"lint": "eslint src/ --ext .js --ext .ts --ext .jsx --ext .tsx",
1822
"format": "prettier --write \"src/**/*.ts\"",
@@ -59,6 +63,7 @@
5963
"react": "^16.13.1",
6064
"react-dom": "^16.13.1",
6165
"react-test-renderer": "^16.13.1",
66+
"rimraf": "^3.0.2",
6267
"ts-jest": "^25.4.0",
6368
"typescript": "^3.8.3"
6469
},

0 commit comments

Comments
 (0)