Add support for Mocha's forbidOnly#103
Conversation
If this flag is set to true, the suite will be marked as failed if you use `describe.only` or `test.only`. If you set this conditionally from an ENV variable (for ex.) you can ensure your CI fails if someone accidentally commits a `.only`.
|
@DanTup we should probably just make sure that our testrunner.d.ts is up to date with the Mocha version we ship. Do you want to take a shot at it? We probably updated mocha dependency many times without keeping this d.ts in sync. What Mocha version is minimally required for this flag to work? |
|
Looks like it was added in 3.5 in July 2017 (this repo currently pulls in 4.0.1): https://github.com/mochajs/mocha/blob/master/CHANGELOG.md#350--2017-07-31 Seems like there are a LOT of options total; not sure if they're all settable in the options object likt this though (not sure how to easily tell short of testing them all): https://github.com/charlierudolph/mocha/blob/master/bin/_mocha#L65L117 |
|
All the docs I can find are incomplete, and there doesn't seem to be a single place in the source with all of the options listed :( |
|
Ok then maybe better we add them ad-hoc 👍 |
If this flag is set to true, the suite will be marked as failed if you use
describe.onlyortest.only. If you set this conditionally from an ENV variable (for ex.) you can ensure your CI fails if someone accidentally commits a.only.Example of it being used (but requires a cast): Dart-Code/Dart-Code@323a508