jeudi 31 décembre 2015

QUnit doesn't rerun all failed tests

I'm using QUnit for the first time and I've run into a weird problem that makes me think I've missed some fundamental part of the setup. I have four tests set up to all fail. When I first load the page, QUnit correctly reports all four failures. When I reload the page, only two tests appear to be run (and they fail).

I've found that if I remove the key-value pairs in the Session Storage, all four tests will be run again. But from my reading of the QUnit docs, it seems like it should be rerunning all of them. "Whenever a test fails, QUnit stores the name of that test in sessionStorage. The next time you run a testsuite, that failing test will run before all other tests" (from http://ift.tt/1R0Wa6b). If I fix the two tests that are reported to be failing, then QUnit will pick one of the others to rerun.

How can I make it run all failed tests every time the page is reloaded?

Thanks!

Here's my code:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>QUnit Example</title>
    <link rel="stylesheet" href="qunit-1.20.0.css">
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture"></div>
<script src="qunit-1.20.0.js"></script>
<script type="application/javascript">

    QUnit.test( "input0", function(assert) {
        assert.equal("qunit", "qunit1", "qunit works");
    });
    QUnit.test( "input1", function(assert) {
        assert.equal("qunit", "qunit2", "qunit works");
    });
    QUnit.test( "input2", function(assert) {
        assert.equal("qunit", "qunit3", "qunit works");
    });
    QUnit.test( "input3", function(assert) {
        assert.equal("qunit", "qunit4", "qunit works");
    });

</script>
</body>
</html>

Aucun commentaire:

Enregistrer un commentaire