Skip to content

๐Ÿ—ƒ run tests related to files changed and tracked by git in pre-commit

Notifications You must be signed in to change notification settings

vinibgoulart/test-pre-commit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

test-pre-commit

run tests related to files changed and tracked by git in pre-commit

make sure the tests related to the files you changed will run and not fail

tags

  • jest
  • pre-commit
  • typescript

How its works

when running the commit to git, the test script will be run before committing.

the script searches if the modified file is a test or has tests in its directory, if true it runs the related tests

How to test

Clone the project

  git clone https://github.com/vinibgoulart/test-pre-commit.git

Go to the project directory

  cd test-pre-commit

Install dependencies

  pnpm install

after that you can change a test file, or a file that has the __tests__ folder in your directory

you can test by giving a git commit, or simulate lint-staged by running:

npx ts-node ./scripts/runPathTests.ts

About

๐Ÿ—ƒ run tests related to files changed and tracked by git in pre-commit

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published