-
Notifications
You must be signed in to change notification settings - Fork 200
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
mocha --watch
breaks the parser
#605
Comments
Interesting, I just reproduced this using one of the samples grammars. |
Try adding:
before your tests, for example at the start of your test module or This resolved the problem in my small reproduction. Not sure how to get a deeper understanding here as I am not sure how to actually |
Maybe I should add a section in the faq about this. |
You can call |
Thanks. I will try to debug is farther, perhaps it would be possible to avoid this workaround. |
I've finally gotten around to debugging this. What happens is that mocha reloads the user files during watch, but not the libraries inside Effectively this creates multiple Parsers with the same name (see #715) I don't see a way to tell mocha to also reload chevrotain each time the tests are re-run |
Nice. Maybe add this to the documentation? Sounds like this just needs to be added to |
I think it needs to be added to the beforeAll of the entire test suite. But it depends on the granularity of mocha --watch. running clearCache too often will slow down the tests as it will force chevrotain to recompute |
I will add a section in the FAQ |
Website will be updated once I republish it again. |
I am reopening this because solving #754 should also fix this issue. |
This should be resolved in 3.7.0 that will be released soon. |
Awesome! 👍 |
😄 |
this is very strange, but when I'm running
mocha
everything works fine, however when usingmocha --watch
only the first run will succeed, after then the parser will always return[]
.Is this a known Issue? I can try to build a minimal example if it will help.
The text was updated successfully, but these errors were encountered: