mocha: Cannot combine --delay and --watch and --require hook
Title says all: this command does not restart my tests when changing them:
mocha --recursive --watch --require setup.js --delay
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 2
- Comments: 23 (7 by maintainers)
@Download I have no
babel
experience per se, but your repo problem would seem a little more basic than that. You never told Mocha to watch your JSX file. Try adding--watch-extensions jsx
; Mocha only watches ‘js’ by default.When run this way, Mocha will show you what is being watched…
Well I be darned!! This actually works! W00t w00t!!!
Wow I cannot believe I spend so many hours trying to get this to work and somehow completely missed this watch-extensions thing. Man this is so great! I have been avoiding mocha + babel in my smaller projects even though I like both because the pain of watch not working was killing all the joy. With this fix I can finally use babel+mocha everywhere!
@plroebuck Thanks man!!!