Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allow deferred test runner in browser wiring

  • Loading branch information...
commit 93df86bb57956b2ea6552fed93dfa20b8367c5ef 1 parent afc7917
@cjohansen cjohansen authored
View
1  lib/buster/browser-wiring.js
@@ -91,6 +91,7 @@
function attemptRun() {
if (!ready || !started || alreadyStarted) { return; }
alreadyStarted = true;
+ if (typeof runner === "function") { runner = runner(); }
if (shouldResetDoc(config)) { B.wire.documentState(runner); }
if (config.captureConsole) { B.captureConsole(); }
B.extend(runner, config);
View
12 test/browser/browser-wiring-test.js
@@ -248,6 +248,18 @@
wire.ready({ captureConsole: true });
assert(B.captureConsole.calledOnce);
+ },
+
+ "should defer creating test runner": function () {
+ var runSuite = sinon.spy();
+ var wire = B.wire.testRunner(function () {
+ return { on: function () {}, runSuite: runSuite };
+ });
+
+ wire.run();
+ wire.ready({});
+
+ assert(runSuite.calledOnce);
}
});
Please sign in to comment.
Something went wrong with that request. Please try again.