28

I can't get QUnit to run any test after the first. To be sure I wasn't doing something weird, I pared down the code to be as basic as possible.

test("A", function () {
    ok(true, "Test A");
});
test("B", function () {
    ok(true, "Test B");
});

Test A is the only one that runs. No errors thrown or anything else.

My HTML file looks like this.

<!DOCTYPE html>
<html>
<head>
   <title>Test title</title>
   <link rel="stylesheet" href="http://code.jquery.com/qunit/qunit-1.10.0.css">
</head>
<body>
   <div id="qunit"></div>
   <script src="http://code.jquery.com/qunit/qunit-1.10.0.js"></script>
   <script src="tests.js" type="text/javascript"></script>
</body>
</html>
Mims H. Wright
  • 3,049
  • 1
  • 25
  • 30

2 Answers2

62

Found the problem. It was this!

qunit.html?testNumber=1

I guess at some point I hit rerun and it ignored the other tests!

This other question deserves credit for pointing me in the right direction. QUnit Won't Run Tests

Community
  • 1
  • 1
Mims H. Wright
  • 3,049
  • 1
  • 25
  • 30
0

very similar to Mims H. Wright's answer.

I also hit "rerun" on a failing test, and it appended the testId to my url, which I didnt notice.

tests.html?testId=fb134038
Lundy
  • 663
  • 5
  • 19