-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests run twice if I add "test" to the pre-commit hook array in package.json #66
Comments
your tests run twice? that's really weird. can you share your package.json with me? also what version of precommit-hook and git-validate is this against? |
"precommit-hook": "^3.0.0" npm list git-validate
|
$ git commit -m "testing pre-commit hook" |
If I remove "test" from the "pre-commit" array in package.json, the tests only fire once. |
ahhh, that's a good hint. ok, i'll investigate more. |
Just a wild guess, no research applied on my part, but I know that your module runs the NPM script named "test" if it isn't defined in the "pre-commit" array. I haven't dug into the module code myself but if I dig around I'll be looking for the logic related to that on the theory that it's maybe not seeing "test" in my "pre-commit" array. |
When I rename "test" to "unit-test" in my "scripts" object, as is expected, it runs them both in succession.
running test...passed! I also tried adding Not sure if that's intended functionality. |
if you have an array set to pre-commit and it doesn't contain "test" then it should be ignored, so that's expected. what's strange is that you're still getting that double test. what operating system are you on? also what version of bash ( can you create a new empty repository and reproduce this issue in it? or does it only happen for one project? |
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin14) I haven't created an empty repo to test it yet but I have two similar projects & it happens in both. I'll spin that empty repo up later today & get back to you brotha. Thanks |
i just realized something.. do you happen to have two |
I do not. I checked around hoping that I'd find a second one that someone on my team might have added inadvertently but other than the node_modules and a few bower_components, like Angular, I don't have more than one package.json |
@Emuentes I know it's been over two years, but is this still an issue? If so, I'd like to resume looking into it. If not, I'd like to close it... |
@Trott I haven't utilized the module in a while, it may still be a thing, I could run a test with it on Thursday. |
No description provided.
The text was updated successfully, but these errors were encountered: