From 525d3e5b994ac44dfef8d159c52866b50c762050 Mon Sep 17 00:00:00 2001 From: nightwing Date: Thu, 31 Mar 2016 15:36:32 +0000 Subject: [PATCH 1/2] fix issue with vfs worker not passing falsy values --- node_modules/vfs-socket/worker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node_modules/vfs-socket/worker.js b/node_modules/vfs-socket/worker.js index 8cf0d3f4..ed7a282b 100644 --- a/node_modules/vfs-socket/worker.js +++ b/node_modules/vfs-socket/worker.js @@ -437,7 +437,7 @@ function Worker(vfs) { var keys = Object.keys(meta || {}); for (var i = 0, l = keys.length; i < l; i++) { var key = keys[i]; - if (!meta[key]) + if (meta[key] == undefined) continue; switch (key) { case "stream": token.stream = storeStream(meta.stream); break; From f904da1073ca866437f27bec173a9dfdeea2f487 Mon Sep 17 00:00:00 2001 From: nightwing Date: Thu, 31 Mar 2016 17:03:28 +0000 Subject: [PATCH 2/2] add test for execfile --- plugins/c9.fs/proc_test.js | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/plugins/c9.fs/proc_test.js b/plugins/c9.fs/proc_test.js index db68c57e..96be5406 100644 --- a/plugins/c9.fs/proc_test.js +++ b/plugins/c9.fs/proc_test.js @@ -37,7 +37,7 @@ require(["lib/architect/architect", "lib/chai/chai"], function (architect, chai) describe('proc', function() { describe('spawn()', function() { - this.timeout(4000); + this.timeout(10000); it("should spawn a child process", function(done) { var args = ["-e", "process.stdin.pipe(process.stdout);try{process.stdin.resume()}catch(e) {};"]; @@ -66,8 +66,8 @@ require(["lib/architect/architect", "lib/chai/chai"], function (architect, chai) }); }); - //should test the kill() method - which is broken now - //Another test - see that cwd defaults to the root vfs dir when resolve is set to true + // should test the kill() method - which is broken now + // Another test - see that cwd defaults to the root vfs dir when resolve is set to true }); describe('execFile()', function() { this.timeout(10000); @@ -101,8 +101,19 @@ require(["lib/architect/architect", "lib/chai/chai"], function (architect, chai) }); }); - //should test the kill() method - which is broken now - //Another test - see that cwd defaults to the root vfs dir when resolve is set to true + it('should pass stdout and stderr', function(done) { + proc.execFile("node", { + args: ["-v"] + }, function(e, stdout, stderr) { + expect(stdout[0]).to.equal("v"); + expect(stderr).to.equal(""); + expect(e).to.not.ok; + done(); + }); + }); + + // should test the kill() method - which is broken now + // Another test - see that cwd defaults to the root vfs dir when resolve is set to true }); describe('pty()', function() { this.timeout(30000);