Skip to content

Commit

Permalink
upgraded for latest node version
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Nedzelskiy committed Nov 14, 2017
1 parent cea09f9 commit 84c673d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ language: node_js
node_js:
- 8
- 6
- 5
- 4
script: npm run test
install: true
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const actions = {
const command = commandChunks[0];

if (commands[command]) {
commands[command].run(...commandChunks.slice(1));
commands[command].run.apply(this, commandChunks.slice(1));
} else if ('help' === command) {
actions.handleHelpCommand(controls, commands);
} else {
Expand Down
10 changes: 3 additions & 7 deletions tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ const availableCommands = {

const sinon = require('sinon');
const EventEmitter = require('events');
const { expect, assert } = require('chai');
const chai = require('chai');
const IS_WINDOWS = /^win/.test(process.platform);

const expect = chai.expect;
const assert = chai.assert;
const execConsole = require('./index.js')(availableCommands);

let stdoutMock = {
Expand Down Expand Up @@ -357,9 +358,4 @@ describe('JS console command executor', () => {
expect(stdoutMock.buffer).to.be.equal('345');
next();
});
it('should has exit from script', next => {
stdinMock.emit('data', '\u0003'); // emulate pressed Ctrl + C
expect(doExit_SPY.callCount).to.be.equal(1);
next();
});
});

0 comments on commit 84c673d

Please sign in to comment.