-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Restrict test modifier chaining #1182
Labels
Milestone
Comments
This was referenced Jan 13, 2017
Closed
novemberborn
added
scope:test-interface
bug
current functionality does not work as desired
labels
Oct 26, 2017
novemberborn
added a commit
that referenced
this issue
Jan 29, 2018
Stop deriving a title from the test implementation function's name. Note that this can't quite be expressed in the type definitions. Hopefully when we tackle #1182 it'll be easier to write the appropriate definition.
novemberborn
added a commit
that referenced
this issue
Jan 29, 2018
Explicitly specify allowable chains, with some ground rules in mind: Test chaining rules: * serial must come at the start * only and skip must come at the end * failing must come at the end, but can be followed by only and skip * only and skip cannot be chained together * no repeating Hook chaining rules: * always comes immediately after "after hooks" * skip must come at the end * no only * no repeating Additionally: * todo cannot be chained, except after serial * all methods except for test are available on serial This commit also removes now unnecessary assertions from TestCollection. Fixes #1182.
novemberborn
added a commit
that referenced
this issue
Jan 30, 2018
Explicitly specify allowable chains, with some ground rules in mind: Test chaining rules: * serial must come at the start * only and skip must come at the end * failing must come at the end, but can be followed by only and skip * only and skip cannot be chained together * no repeating Hook chaining rules: * always comes immediately after "after hooks" * skip must come at the end * no only * no repeating Additionally: * todo cannot be chained, except after serial * all methods except for test are available on serial This commit also removes now unnecessary assertions from TestCollection. Fixes #1182.
novemberborn
added a commit
that referenced
this issue
Feb 4, 2018
Explicitly specify allowable chains, with some ground rules in mind: Test chaining rules: * `serial` must come at the start * `only` and `skip` must come at the end * `failing` must come at the end, but can be followed by `only` and `skip` * `only` and `skip` cannot be chained together * no repeating Hook chaining rules: * `always` comes immediately after "after hooks" * `skip` must come at the end * no `only` * no repeating Additionally: * `todo` cannot be chained, except after `serial` * hooks are not available on `serial` This commit also removes now unnecessary assertions from TestCollection. Fixes #1182.
novemberborn
added a commit
that referenced
this issue
Feb 4, 2018
Explicitly specify allowable chains, with some ground rules in mind: Test chaining rules: * `serial` must come at the start * `only` and `skip` must come at the end * `failing` must come at the end, but can be followed by `only` and `skip` * `only` and `skip` cannot be chained together * no repeating Hook chaining rules: * `always` comes immediately after "after hooks" * `skip` must come at the end * no `only` * no repeating Additionally: * `todo` cannot be chained, except after `serial` * hooks are not available on `serial` This commit also removes now unnecessary assertions from TestCollection. Fixes #1182.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Currently test modifiers allow silly and confusing combinations. We have linting rules to warn about them, and disallow some of them in the type definitions. We should go further and restrict the modifier chains so only useful combinations are allowed, but provide useful error feedback if disallowed combinations are used.
Examples of silly chains:
test.always.afterEach.cb()
test.after.test()
test.always.always.serial.always.afterEach(() => {})
Examples of confusing chains:
test.serial.afterEach()
(test.serial.afterEach #1178)See also the discussion in #1005.
The text was updated successfully, but these errors were encountered: