-
Notifications
You must be signed in to change notification settings - Fork 65
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
Get rid of "--delay" mocha CLI option #364
Conversation
This is needed to fix #363. The `--delay` option requires the code to call the `run` function only once and we were calling it multiple times. More importantly, Mocha does not catch exceptions thrown at the root level and simply reports nothing when that happens. These exceptions typically get thrown when the IDL cannot be parsed, meaning that invalid data exceptions mostly went unnoticed... This update wraps all code that needs to run before tests in a `before` function. Note the need to keep a "dummy" test at the root level, otherwise the `before` function won't run (and wouldn't have anywhere to report failure). This update slightly improves describe/it tests naming as well.
Dammit, I inadvertently committed additional unicity tests for CSS that cannot pass today. Will rollback... |
Too early for that :)
Tests now fail because they actually run, and detect that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I fully understand the mocha magic, but I'm more than happy to trust that it works :)
A few nits worth fixing (even though they were not introduced by this PR)
Co-authored-by: Dominique Hazael-Massieux <dom@w3.org>
Co-authored-by: Dominique Hazael-Massieux <dom@w3.org>
Co-authored-by: Dominique Hazael-Massieux <dom@w3.org>
Co-authored-by: Dominique Hazael-Massieux <dom@w3.org>
Co-authored-by: Dominique Hazael-Massieux <dom@w3.org>
Co-authored-by: Dominique Hazael-Massieux <dom@w3.org>
This is needed to fix #363. The
--delay
option requires the code to call therun
function only once and we were calling it multiple times. More importantly, Mocha does not catch exceptions thrown at the root level and simply reports nothing when that happens. These exceptions typically get thrown when the IDL cannot be parsed, meaning that invalid data exceptions mostly went unnoticed...This update wraps all code that needs to run before tests in a
before
function. Note the need to keep a "dummy" test at the root level, otherwise thebefore
function won't run (and wouldn't have anywhere to report failure). This workaround is somewhat documented in mocha's repository, see mochajs/mocha#2116 (comment)This update slightly improves describe/it tests naming as well.