Cypress tests breaks husky and pre-commit: TypeError: dest.end is not a function
See original GitHub issueI have tests written in cypress. Calling npm test
works perfectly. But then I defined a pre-commit hook with husky and it runs the tests but breaks in the end with TypeError: dest.end is not a function
.
At first I thought this was a problem with husky, not cypress, especially because running npm test
directly works perfectly. So I opened an issue on husky about it, one month ago. But apparently this problem also occurs with a different git hooking library (namely pre-commit) as well.
This made me think that the problem might actually be in cypress, so I decided to open this issue. One of my guesses is that since cypress does a lot of magic, including calling other executables, maybe it somehow messed up the “completion” of the script in a way that works for direct npm test
but doesn’t work when another library is trying to do something with the script output, error code or something like that.
Please take a look at the linked issue on husky for the full details, including the fully reproducible steps.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
So this comment seems to have a potential solution for this problem. Not sure what the next steps are to solve this though or where the problem lies exactly. @bahmutov any thoughts?
This issue could be related as well https://github.com/cypress-io/cypress/issues/2181 I was looking into running cypress in a pre-commit hook as well but we decided to run it on a gitlab merge request so Im not dealing with it anymore. Using git bash on windows with pre-commit causes this error but running cypress through git bash normally works which is odd