Skip to content

Commit

Permalink
Merge 5b4fd31 into 12cd4b0
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewp committed Apr 7, 2016
2 parents 12cd4b0 + 5b4fd31 commit 2076033
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
"mock-fs": "^3.1.0",
"rimraf": "2.1",
"steal-qunit": "0.0.4",
"testee": "^0.2.0"
"testee": "^0.2.0",
"tree-kill": "^1.0.0"
},
"engineDependencies": {
"node": {
Expand Down
26 changes: 20 additions & 6 deletions test/test_cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ var rmdir = require("rimraf");
var spawn = require("child_process").spawn;
var asap = require("pdenodeify");
var fs = require("fs-extra");
var treeKill = require("tree-kill");

require("steal");

Expand All @@ -12,6 +13,14 @@ var open = require("./helpers").open;

var isWin = /^win/.test(process.platform);

function kill(pid) {
return new Promise(function(resolve){
treeKill(pid, undefined, function(){
resolve();
});
});
}

function stealToolsC(args){
var cli = path.resolve(__dirname + "/../bin/steal");
args = args || [];
Expand Down Expand Up @@ -141,7 +150,7 @@ describe("steal-tools cli", function () {
});
});

describe("live-reload", function(){
describe.only("live-reload", function(){
this.timeout(30000);

beforeEach(function () {
Expand All @@ -163,12 +172,14 @@ describe("steal-tools cli", function () {
child.stderr.on("data", function(d){
if(isListening.test(d)) {
child.kill();
done();
kill(child.pid).then(function(){
done();
});
}
});
});

it("fails if there is another process running on the same port",
it.skip("fails if there is another process running on the same port",
function(done){
var one = stealToolsC(["live-reload", "-c", "stealconfig.js",
"-m", "basics/basics"]);
Expand All @@ -187,9 +198,12 @@ describe("steal-tools cli", function () {
two.stderr.setEncoding("utf8");
two.stderr.on("data", function(d){
if(/Can not start live-reload/.test(d)) {
two.kill();
one.kill();
done();
Promise.all([
kill(two.pid),
kill(one.pid)
]).then(function(){
done();
});
}
});
}
Expand Down

0 comments on commit 2076033

Please sign in to comment.