question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Something 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:closed
  • Created 9 years ago
  • Comments:30 (27 by maintainers)

github_iconTop GitHub Comments

2reactions
wycatscommented, Apr 29, 2017

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.

slow and steady wins the race

0reactions
trentmwilliscommented, Jun 7, 2016

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:

{
  "failed": 1,
  "expectedFailures": 2
}

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.

I do think consumer code will be simpler if we don’t wrap them in a sub-object.

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:

{
  "total": 4,
  "passed": 3,
  "failed": 1,
  "passedUnexpectedly": 1,
  "failedUnexpectedly": 0
}
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found