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

Add support for Mocha's forbidOnly #103

Merged
merged 1 commit into from Mar 24, 2018

Conversation

Projects
None yet
2 participants
@DanTup
Copy link
Contributor

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

Add support for Mocha's forbidOnly
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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor

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

1 check passed

license/cla All CLA requirements met.
@bpasero

This comment has been minimized.

Copy link
Member

bpasero commented Mar 24, 2018

Ok then maybe better we add them ad-hoc 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment