Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[lib test] fixed bad libev call, tests fixed

  • Loading branch information...
commit 8205b30a00b1a26d2b2c69e1a6ddd5598b8a3664 1 parent f5b6fab
@jamesonjlee jamesonjlee authored
Showing with 9 additions and 16 deletions.
  1. +0 −8 lib/carapace.js
  2. +9 −8 test/helper/macros.js
View
8 lib/carapace.js
@@ -196,14 +196,6 @@ carapace.run = function (script, argv, override, callback) {
callback();
}
});
-
- //
- // Dereference `libev` so that this connection
- // does not keep the event loop alive, create ghost-nodes
- // this forces process.nextTick (above) to fire
- // and unreferences the runMain() from above
- //
- evref.unref();
return carapace;
};
View
17 test/helper/macros.js
@@ -117,27 +117,28 @@ macros.assertParentSpawn = function (PORT, script, argv, cwd, vows) {
carapace.on('*::port', function onPort (source, ev, port) {
if (port && port !== carapace['hook-port']) {
that.port = port;
- that.callback(null, source, ev, port);
+ that.callback(null, source, ev, port, child);
carapace.removeListener('*::port', onPort);
}
});
},
"should emit the `*::port` event": {
- topic: function (source, ev, port) {
- this.callback(null, source, ev, port);
+ topic: function (source, ev, port, child) {
+ this.callback(null, source, ev, port, child);
},
- "with the correct port": function (err, source, event, port) {
+ "with the correct port": function (err, source, event, port, child) {
assert.equal(event, '*::port');
assert.equal(port, this.port);
assert.notEqual(port, carapace['hook-port'])
},
"should correctly start the HTTP server": {
- topic: function () {
- request({ uri: 'http://localhost:' + this.port }, this.callback);
+ topic: function (_,_,_,child) {
+ request({ uri: 'http://localhost:' + this.port }, this.callback.bind(null, null, child));
},
- "that responds with a cwd": function (err, res, body) {
+ "that responds with a cwd": function (_, child, err, res, body) {
+ child.kill();
assert.equal(body, cwd);
- }
+ },
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.