Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated AMD tests

  • Loading branch information...
commit ea9fc405e0fed81a5c76c7b5e65e0c72ece1d80f 1 parent 3529dfd
@kmalakoff authored
View
2  test/knockback-page-navigator-panes/test-amd.coffee
@@ -23,4 +23,4 @@ try
require ['underscore', 'backbone', 'knockout', 'knockback', 'knockback-page-navigator-panes', 'qunit_test_runner'], (_, Backbone, ko, kb, kbn, runner) ->
window._ = window.Backbone = window.ko = null # force each test to require dependencies synchronously
# window.kb = null # force each test to require dependencies synchronously
- runner.start(); require ['./build/test'], ->
+ require ['./build/test'], -> runner.start()
View
2  test/knockback-page-navigator-simple/test-amd.coffee
@@ -23,4 +23,4 @@ try
require ['underscore', 'backbone', 'knockout', 'knockback', 'knockback-page-navigator-simple', 'qunit_test_runner'], (_, Backbone, ko, kb, kbn, runner) ->
window._ = window.Backbone = window.ko = null # force each test to require dependencies synchronously
# window.kb = null # force each test to require dependencies synchronously
- runner.start(); require ['./build/test'], ->
+ require ['./build/test'], -> runner.start()
View
2  test/knockback-pane-navigator/test-amd.coffee
@@ -23,4 +23,4 @@ try
require ['underscore', 'backbone', 'knockout', 'knockback', 'knockback-pane-navigator', 'qunit_test_runner'], (_, Backbone, ko, kb, kbn, runner) ->
window._ = window.Backbone = window.ko = null # force each test to require dependencies synchronously
# window.kb = null # force each test to require dependencies synchronously
- runner.start(); require ['./build/test'], ->
+ require ['./build/test'], -> runner.start()
View
21 vendor/test/qunit/qunit_test_runner.js
@@ -1,9 +1,20 @@
(function() {
+ var started = false,
+ interval = null;
+ QUnit.done(function(details) {
+ if (!started) return;
+ clearInterval(interval);
+ if (!details.total) {
+ $('#qunit-banner').removeClass('qunit-pass').addClass('qunit-fail');
+ throw new Error('Warning: no tests run');
+ }
+ });
var startRunner = function() {
+ started = true;
var start = Date.now();
var timeout = 60000;
- var interval = setInterval((function() {
+ interval = setInterval((function() {
var code, stats;
if (Date.now() > start + timeout) {
// TIMEOUT
@@ -11,14 +22,6 @@
throw 'Warning: tests timed out';
}
}), 500);
-
- QUnit.done(function(details) {
- clearInterval(interval);
- if (!details.total) {
- $('#qunit-banner').removeClass('qunit-pass').addClass('qunit-fail');
- throw new Error('Warning: no tests run');
- }
- });
};
// AMD
Please sign in to comment.
Something went wrong with that request. Please try again.