Pendings tests
See original GitHub issueSomething that came out of a discussion with Yehuda: During a big refactoring they have hundreds of failing tests. They turned them off using QUnit.skip
, but that doesn’t tell them which of the skipped tests starting passing again at some point. To quickly test changes in passing tests, they ended up with this:
QUnit.skip = QUnit.test;
There’s probably a better way to deal with that situation. One idea is to have something like a QUnit.pending
method, that has the same signature as QUnit.test()
, but will reverse the result. So if all assertions pass, the test fails, if at least one fails, the test passes.
The HTML reporter could use a similar marker as QUnit.skip
.
Thoughts?
Update 2015-04-15:
After some discussion, we came up with this:
// This test will show up with a "todo" badge, with a similar style as the "skipped" badge
// It will show as passed when at least one assertion fails, or fail when all assertions pass
QUnit.todo( "this isn't implemented, yet" function( assert ) {
assert.ok( featureTest(), "waiting for feature" );
} );
QUnit.testDone( function( details ) {
console.log( details.name, details.todo );
//> "this isn't implemented, yet" true
} );
QUnit.log( function( details ) {
console.log( details.message, details.todo );
//> "waiting for feature" true
} );
Issue Analytics
- State:
- Created 9 years ago
- Comments:30 (27 by maintainers)
Top Results From Across the Web
What does 'pending' test mean in Mocha, and how can I make ...
A test can end up being shown by Mocha as "pending" when you inadvertently closed the test's it method early, like:
Read more >Cypress Test Statuses - Gleb Bahmutov
After the Cypress spec completes every test has one of the 4 statuses: passing, failing, pending, or skipped. Let's look into each status....
Read more >Pending Tests - Fundamentals of Testing Using Rails
Learn how to make the unit test pass using the pending test. ... The :pending argument; The pending method; Pending tests failures; Skipping...
Read more >Delayed root suite pending tests, exclusive tests and inclusive ...
The pending tests will be included in the test results, and will be marked as pending. A pending test will not be considered...
Read more >Pending Laboratory Test Results at the Time of Discharge
Pending laboratory test results at discharge can have major adverse health outcomes. The availability of test results at discharge may depend on whether...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Incidentally, my first comment here was that if this landed we’d use it. Glimmer is already using it 😃
Thanks for keeping on top of this over a very long development cycle. It’s why I love qunit.
I had considered using “expected”, but that actually doesn’t provide enough contextual information. For example, if you have two expected failures from a
todo
, but wind up with an unexpected failure it would still be reported as:Giving you no way of knowing whether that failure was one of the expected ones or not. Since we’re primarily concerned with the “unexpected” events, reporting those doesn’t have that issue.
That’s fine with me, I’m particularly concerned with naming consistency over the exact shape. I’m going to pursue an implementation following like so: