Skip to content

Commit

Permalink
Add husky to project (#24)
Browse files Browse the repository at this point in the history
Runs tests before committing.
  • Loading branch information
lyncasterc authored Mar 15, 2024
1 parent 50d5f25 commit 1453b48
Show file tree
Hide file tree
Showing 4 changed files with 235 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(cd ./frontend && npm run lint && npm test -- --watchAll=false && npm run cypress:tests-cli)

(cd ./backend && npm run lint && npm test)
226 changes: 217 additions & 9 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"cypress:open": "cypress open",
"cypress:run": "cypress run",
"cypress:tests": "concurrently \"npm run server:test\" \"npm start\" \"npm run cypress:open\"",
"cypress:tests-cli": "concurrently \"npm run server:test\" \"npm start\" \"npm run cypress:run\"",
"cypress:tests-cli": "start-test server:test 3001/health start 3000 cypress:run",
"lint": "eslint .",
"ts-jest:init": "npx ts-jest config:init",
"jest-preview": "jest-preview"
Expand Down Expand Up @@ -71,6 +71,7 @@
"eslint-plugin-react": "^7.29.4",
"eslint-plugin-react-hooks": "^4.4.0",
"msw": "^0.39.2",
"start-server-and-test": "^2.0.3",
"ts-jest": "^27.1.4"
}
}
13 changes: 13 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "instaclone",
"version": "1.0.0",
"description": "Instaclone is an Instagram clone written using the MERN stack + TypeScript.",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"prepare": "husky"
},
"keywords": [],
"author": "",
"license": "ISC"
}

0 comments on commit 1453b48

Please sign in to comment.