Skip to content

Commit

Permalink
Critical fix for incorrect push args
Browse files Browse the repository at this point in the history
  • Loading branch information
rwaldron committed Jan 17, 2016
1 parent 3288afe commit a7ad468
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/tessel/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ actions.runScript = function(t, filepath, opts) {
});
};

actions.pushScript = function(t, opts) {
actions.pushScript = function(t, script, opts) {
// Write the node start file
return actions.writeToFile(t, opts.entryPoint)
.then(function start() {
Expand Down
12 changes: 11 additions & 1 deletion test/unit/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ exports['Tessel.prototype.deployScript'] = {
this.setExecutablePermissions = sandbox.spy(commands, 'setExecutablePermissions');
this.startPushedScript = sandbox.spy(commands, 'startPushedScript');

this.pushScript = sandbox.spy(deploy, 'pushScript');
this.writeToFile = sandbox.spy(deploy, 'writeToFile');

this.injectBinaryModules = sandbox.stub(deploy, 'injectBinaryModules', function() {
return Promise.resolve();
});
Expand Down Expand Up @@ -236,12 +239,19 @@ exports['Tessel.prototype.deployScript'] = {
},

pushScript: function(test) {
test.expect(10);
test.expect(13);
deployTestCode(this.tessel, test, {
push: true,
single: false
}, function deployed(err) {
test.ifError(err);

var expectedPath = path.normalize('test/unit/tmp/app.js');

test.equal(this.pushScript.lastCall.args[1], expectedPath);
test.equal(this.pushScript.lastCall.args[2].entryPoint, expectedPath);
test.equal(this.writeToFile.lastCall.args[1], expectedPath);

test.equal(this.stopRunningScript.callCount, 1);
// Delete and create both the flash and ram folders
test.equal(this.deleteFolder.callCount, 2);
Expand Down

0 comments on commit a7ad468

Please sign in to comment.