-
Notifications
You must be signed in to change notification settings - Fork 781
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 ability to mark a Test as skipped or incomplete #637
Comments
It would be great if you could implement this as a plugin, that way we don't have to commit to an API just yet, and anyone interested in this feature, like you, could start using it. For some ideas on how to implement this, some other approaches for the API and more discussion, see #434 If you need help implementing a QUnit plugin, check out the existing plugins, or ask me or @leobalter, e.g. via #jquery-dev on Freenode. |
To clarify, a plugin would be great to pave the way for landing this in QUnit itself. |
The trouble with creating this as a plugin is that the plugin would have to alter the state of test result data (e.g. to a It definitely needs to be part of QUnit core or else it will become a big PITA for the plugin maintainers to continue updating it to duck-punch/hack various new/updated Reporters. |
Same goes for the "pending" feature discussed in #434, i.e. for tests that have only been stubbed in by name but not implemented. Syntax would be to not include the function callback in the call to test("TODO: Implement this test that does X"); |
Perhaps we could add a generic
|
skipped/pending/future/etc. seem to mean the same thing functionally, and do appear in other Javascript frameworks. Jasmine x-prefixes functions ( |
One of the objections I have, or used to have, was that this feature could be used to write placeholders or disable tests that then stick around forever. The alternative, commenting tests, is usually worse though. With that in mind, I'm currently toying with the idea of adding an expiration date to skips: skip("this no worky", "2014-08-26", function() { ... }); Which would be okay for, say, a month, then starts to fail. Probably not feasible, but maybe this inspires someone to come up with a better concept that addresses the problem of disabled tests rotting away. |
@jzaefferer In the plugin I was planning on having comments logged on skipped tests. This forces people to be aware of the skipped tests and bring attention to them if need be. |
@jzaefferer It's difficult to get too specific while QUnit is still feeling out syntax options, but I could see something like |
I think the reason skipping works in other test frameworks is the simplicity behind it. I feel if we begin adding timeout dates/conditionals it'll over complicate the feature, which should be avoided. |
Can we get some manner of consensus on if we're discussing 1 or 2 goals here, and if both are desired? I view the discussion as:
I think both goals are worthy but that their implementation and evaluation in the UI would be different, IMHO. However, as they are similar, it is probably a good idea to discuss them together at the onset. |
Taking inspiration from TAP this time, I'd like to recast the terminology while preserving mutual compatibility:
Discussion in this ticket has centered on SKIP, but past examples would actually benefit more from TODO. At any rate, I prefer |
Awesome! I didn't realize any other frameworks/protocol had both of these.
Agreed.
True. Which status would that result in, though? SKIP or TODO? I'm leaning toward SKIP. |
Agreed. TODO, if introduced, should be entirely distinct and explicitly opt-in (come to think of it, that clarity would another benefit of not supporting |
I don't know... I would prefer |
@JamesMGreene |
Oh, didn't read that closely enough before. That's strange behavior to me. I would envision TODO as a test without a callback (or at least no assertions). I would envision what you described not as a test status at all but rather an assertion that cannot fail, e.g. |
Ok, I think that's reason enough to take TODO off the table for this issue and focus on SKIP (which is entirely appropriate given its description). I just wanted to make sure that we don't end up unnecessarily inconsistent with the field of existing technologies, in which skip means "don't run, but report the fact" and todo means "run, but don't let failures fail the containing group" and both are conceptually applicable at assertion, test, and suite level. |
Is there any reason for If so, since the interest is still there and there seems to be some agreement on the API design, a PR that implements Would also be nice to include the semantics of this new method in the description of the PR. We should be able to use that text for the API documentation later. |
@jzaefferer Awesome, I think adding |
Fixes qunitjs#637 Fixes qunitjs#434
Fixes qunitjs#637 Fixes qunitjs#434
Fixes qunitjs#637 Fixes qunitjs#434
Also logs skipped tests on testDone callback that are handled on the html reporter Fixes qunitjs#637 Fixes qunitjs#434
Also logs skipped tests on testDone callback that are handled on the html reporter Fixes qunitjs#637 Fixes qunitjs#434
Also logs skipped tests on testDone callback that are handled on the html reporter Fixes qunitjs#637 Fixes qunitjs#434
Also logs skipped tests on testDone callback that are handled on the html reporter Fixes qunitjs#637 Fixes qunitjs#434
For anyone else who wants the Mocha-style "pending" syntax, I created this little plugin to build on top of @leobalter's Since QUnit core P.S. I fully admit this syntax is harder to search for. |
Ref qunitjs/qunit#637 Ref qunitjs/qunit#652 Fixes #75 Closes #77
Past discussion: #434
Would a PR adding the ability to skip tests be a welcome change? On a custom fork of TinyMCE we're modifying the functionality and as such certain tests are failing. We want to keep the tests in the codebase and are currently forced to comment them out. Having the ability to skip tests would be the best solution in this case.
The syntax would be
test.skip(func...)
.I'll gladly make a PR for this, just looking for approval before I start working.
The text was updated successfully, but these errors were encountered: