Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Add support for Mocha's forbidOnly #103

Merged
merged 1 commit into from
Mar 24, 2018
Merged

Conversation

DanTup
Copy link
Contributor

@DanTup DanTup commented Mar 22, 2018

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.

screen shot 2018-03-22 at 12 32 33

Example of it being used (but requires a cast): Dart-Code/Dart-Code@323a508

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`.
@bpasero
Copy link
Member

bpasero commented Mar 23, 2018

@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?

@DanTup
Copy link
Contributor Author

DanTup commented Mar 24, 2018

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

@DanTup
Copy link
Contributor Author

DanTup commented Mar 24, 2018

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 :(

@bpasero bpasero merged commit 8c08203 into microsoft:master Mar 24, 2018
@bpasero
Copy link
Member

bpasero commented Mar 24, 2018

Ok then maybe better we add them ad-hoc 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants