Skip to content

Commit 1453b48

Browse files
authored
Add husky to project (#24)
Runs tests before committing.
1 parent 50d5f25 commit 1453b48

File tree

4 files changed

+235
-10
lines changed

4 files changed

+235
-10
lines changed

.husky/pre-commit

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
(cd ./frontend && npm run lint && npm test -- --watchAll=false && npm run cypress:tests-cli)
2+
3+
(cd ./backend && npm run lint && npm test)

frontend/package-lock.json

+217-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"cypress:open": "cypress open",
4242
"cypress:run": "cypress run",
4343
"cypress:tests": "concurrently \"npm run server:test\" \"npm start\" \"npm run cypress:open\"",
44-
"cypress:tests-cli": "concurrently \"npm run server:test\" \"npm start\" \"npm run cypress:run\"",
44+
"cypress:tests-cli": "start-test server:test 3001/health start 3000 cypress:run",
4545
"lint": "eslint .",
4646
"ts-jest:init": "npx ts-jest config:init",
4747
"jest-preview": "jest-preview"
@@ -71,6 +71,7 @@
7171
"eslint-plugin-react": "^7.29.4",
7272
"eslint-plugin-react-hooks": "^4.4.0",
7373
"msw": "^0.39.2",
74+
"start-server-and-test": "^2.0.3",
7475
"ts-jest": "^27.1.4"
7576
}
7677
}

package.json

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "instaclone",
3+
"version": "1.0.0",
4+
"description": "Instaclone is an Instagram clone written using the MERN stack + TypeScript.",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1",
8+
"prepare": "husky"
9+
},
10+
"keywords": [],
11+
"author": "",
12+
"license": "ISC"
13+
}

0 commit comments

Comments
 (0)