From d18edacecc28b62d5ba32386b3ee80f5029163aa Mon Sep 17 00:00:00 2001 From: David Costa Date: Thu, 18 Jul 2019 20:29:09 -0300 Subject: [PATCH] Add husky and improve scripts --- package.json | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 9b82798..7e0636f 100644 --- a/package.json +++ b/package.json @@ -4,9 +4,10 @@ "description": "Middleware and helpers to improve the React-Redux flow when communicating with APIs.", "main": "index.js", "scripts": { - "coveralls": "jest --coverage && cat ./coverage/lcov.info | coveralls", + "coveralls": "npm run test && cat ./coverage/lcov.info | coveralls", "lint": "eslint lib/** __tests__/**", - "test": "jest", + "test": "jest --coverage", + "jest": "jest", "test_debug": "node --inspect node_modules/.bin/jest" }, "repository": { @@ -37,6 +38,7 @@ "eslint-config-prettier": "^6.0.0", "eslint-plugin-import": "^2.18.0", "eslint-plugin-prettier": "^3.1.0", + "husky": "^3.0.1", "jest": "^24.8.0", "jest-fetch-mock": "^2.1.2", "prettier": "^1.18.2" @@ -45,6 +47,20 @@ "automock": false, "setupFiles": [ "/setupJest.js" - ] + ], + "coverageThreshold": { + "global": { + "branches": 100, + "functions": 100, + "lines": 100, + "statements": 100 + } + } + }, + "husky": { + "hooks": { + "pre-commit": "npm run lint && npm run test", + "pre-push": "npm run lint && npm run test" + } } }