diff --git a/.husky/.gitignore b/.husky/.gitignore new file mode 100644 index 0000000..31354ec --- /dev/null +++ b/.husky/.gitignore @@ -0,0 +1 @@ +_ diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..449fcde --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npm test diff --git a/package-lock.json b/package-lock.json index b9202f5..4906475 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4042,6 +4042,12 @@ "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", "dev": true }, + "husky": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/husky/-/husky-6.0.0.tgz", + "integrity": "sha512-SQS2gDTB7tBN486QSoKPKQItZw97BMOd+Kdb6ghfpBc0yXyzrddI0oDV5MkDAbuB4X2mO3/nj60TRMcYxwzZeQ==", + "dev": true + }, "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", diff --git a/package.json b/package.json index 9639e33..4ea4a3d 100644 --- a/package.json +++ b/package.json @@ -2,10 +2,12 @@ "name": "calc-training", "version": "1.0.0", "scripts": { - "dev": "vite", "build": "vite build", + "dev": "vite", + "prepare": "husky install", "serve": "vite preview", - "test": "eslint 'src/**' && jest -i" + "test": "eslint 'src/**' && jest -i", + "test:watch": "jest --watchAll" }, "dependencies": { "firebase": "8.3.2", @@ -25,6 +27,7 @@ "eslint-plugin-promise": "4.3.1", "eslint-plugin-react": "7.23.1", "eslint-plugin-react-hooks": "4.2.0", + "husky": "6.0.0", "jest": "26.6.3", "postcss-preset-env": "6.7.0", "prop-types": "15.7.2",