From 1aa40f6d7101248fb65480b294dae2a9586f9443 Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Tue, 14 Jun 2016 16:53:42 -0400 Subject: [PATCH] followup: t2 run: hook up process.stdin to remote.stdin Signed-off-by: Rick Waldron --- lib/tessel/deploy.js | 1 + test/unit/deploy.js | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/tessel/deploy.js b/lib/tessel/deploy.js index e06db977..a2b93f79 100644 --- a/lib/tessel/deploy.js +++ b/lib/tessel/deploy.js @@ -383,6 +383,7 @@ exportables.run = function(tessel, opts) { // Pipe input TO the remote process. process.stdin.pipe(remoteProcess.stdin); + process.stdin.setRawMode(true); // Pipe output FROM the remote process. remoteProcess.stdout.pipe(process.stdout); diff --git a/test/unit/deploy.js b/test/unit/deploy.js index 132f3554..215483dc 100644 --- a/test/unit/deploy.js +++ b/test/unit/deploy.js @@ -524,7 +524,7 @@ exports['deploy.run'] = { }, runStdInOut: function(test) { - test.expect(1); + test.expect(4); this.exec = sandbox.stub(this.tessel.connection, 'exec', (command, options, callback) => { callback(null, this.tessel._rps); @@ -532,12 +532,16 @@ exports['deploy.run'] = { }); this.stdinPipe = sandbox.stub(process.stdin, 'pipe'); + this.stdinSetRawMode = sandbox.stub(process.stdin, 'setRawMode'); deploy.run(this.tessel, { resolvedEntryPoint: 'foo', lang: deployment.js, }).then(() => { test.equal(this.stdinPipe.callCount, 1); + test.equal(this.stdinPipe.lastCall.args[0], this.tessel._rps); + test.equal(this.stdinSetRawMode.callCount, 1); + test.equal(this.stdinSetRawMode.lastCall.args[0], true); test.done(); }); },