This guide will walk you through the steps to setup git hooks (pre-commits, pre-push
) using Husky. Additionally we will be using package lint-staged
which tracks of staged code files and run jest tests related to those files on each commit.
Let's set it up!
- Install the following packages
npm install --save-dev husky lint-staged jest ts-jest @types/jest