Skip to content
This repository has been archived by the owner on Jun 5, 2020. It is now read-only.

Commit

Permalink
Pass browser runner results to callback
Browse files Browse the repository at this point in the history
  - Avoid incorrect exit code of 1 for successful tests
  • Loading branch information
cjohansen committed Jul 10, 2012
1 parent ba971ae commit fca05c2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/runners/browser.js
Expand Up @@ -243,9 +243,9 @@ var testRun = {
return callback(hookError); return callback(hookError);
} }


runner.on("suite:end", function () { runner.on("suite:end", function (results) {
this.endSession(session); this.endSession(session);
callback(); callback(null, results);
}.bind(this)); }.bind(this));
}.bind(this)); }.bind(this));
}, },
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{ {
"name": "buster-test-cli", "name": "buster-test-cli",
"version": "0.6.1", "version": "0.6.2",
"description": "Cli tools for Buster.JS test runners", "description": "Cli tools for Buster.JS test runners",
"homepage": "http://busterjs.org/docs/buster-test-cli", "homepage": "http://busterjs.org/docs/buster-test-cli",
"author": { "name": "August Lilleaas and Christian Johansen" }, "author": { "name": "August Lilleaas and Christian Johansen" },
Expand Down
3 changes: 2 additions & 1 deletion test/runners/browser-test.js
Expand Up @@ -705,9 +705,10 @@ buster.testCase("Browser runner", {
var callback = this.spy(); var callback = this.spy();


this.run.runTests(this.session, callback); this.run.runTests(this.session, callback);
this.remoteRunner.emit("suite:end"); this.remoteRunner.emit("suite:end", { ok: true });


assert.calledOnce(callback); assert.calledOnce(callback);
assert.calledWith(callback, null, { ok: true });
}, },


"prints to stderr on unsuccesful session close": "prints to stderr on unsuccesful session close":
Expand Down

0 comments on commit fca05c2

Please sign in to comment.