Permalink
Browse files

Adds missing close callback.

  • Loading branch information...
1 parent 095ee26 commit 2b7a8106da69747012abe3af92b09892c41343da @johanneswuerbach johanneswuerbach committed Jul 15, 2013
Showing with 16 additions and 1 deletion.
  1. +6 −1 lib/sauce-connect-launcher.js
  2. +10 −0 test/sauce-connect-launcher.test.js
@@ -190,7 +190,12 @@ function run(options, callback) {
openProcesses.push(child);
- child.close = function () {
+ child.close = function (closeCallback) {
+ if (closeCallback) {
+ child.on("close", function () {
+ closeCallback();
+ });
+ }
child.kill("SIGTERM");
};
}
@@ -90,6 +90,16 @@ describe("Sauce Connect Launcher", function () {
done();
});
});
+
+ it("should execute a provided close callback", function (done) {
+ sauceConnectLauncher(sauceCreds, function (err, sauceConnectProcess) {
+ if (err) { throw err; }
+ expect(sauceConnectProcess).to.be.ok();
+ sauceConnectProcess.close(function () {
+ done();
+ });
+ });
+ });
}
});

0 comments on commit 2b7a810

Please sign in to comment.