Add npm test to travis ci
parent
aff6f3c8a1
commit
2e5bdae80e
|
@ -19,11 +19,15 @@ language: node_js
|
||||||
node_js:
|
node_js:
|
||||||
- 8.11.2
|
- 8.11.2
|
||||||
|
|
||||||
|
addons:
|
||||||
|
chrome: stable
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- npm i -g npm@6.0.1
|
- npm i -g npm@6.0.1
|
||||||
- npm install gulp -g
|
- npm install gulp -g
|
||||||
|
|
||||||
script:
|
script:
|
||||||
|
- npm test
|
||||||
- gulp release
|
- gulp release
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then gulp release --chromeos; fi
|
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then gulp release --chromeos; fi
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
"_postinstall": "node ./node_modules/platform-dependent-modules/cli.js",
|
"_postinstall": "node ./node_modules/platform-dependent-modules/cli.js",
|
||||||
"postinstall": "npm run _postinstall",
|
"postinstall": "npm run _postinstall",
|
||||||
"gulp": "gulp",
|
"gulp": "gulp",
|
||||||
"test": "karma start src/test/karma.conf.js"
|
"test": "karma start test/karma.conf.js"
|
||||||
},
|
},
|
||||||
"window": {
|
"window": {
|
||||||
"show": false,
|
"show": false,
|
||||||
|
|
|
@ -256,14 +256,14 @@ TABS.cli.read = function (readInfo) {
|
||||||
case lineFeedCode:
|
case lineFeedCode:
|
||||||
if (GUI.operating_system != "MacOS") {
|
if (GUI.operating_system != "MacOS") {
|
||||||
writeLineToOutput(this.cliBuffer);
|
writeLineToOutput(this.cliBuffer);
|
||||||
|
this.cliBuffer = "";
|
||||||
}
|
}
|
||||||
this.cliBuffer = "";
|
|
||||||
break;
|
break;
|
||||||
case carriageReturnCode:
|
case carriageReturnCode:
|
||||||
if (GUI.operating_system == "MacOS") {
|
if (GUI.operating_system == "MacOS") {
|
||||||
writeLineToOutput(this.cliBuffer);
|
writeLineToOutput(this.cliBuffer);
|
||||||
|
this.cliBuffer = "";
|
||||||
}
|
}
|
||||||
this.cliBuffer = "";
|
|
||||||
break;
|
break;
|
||||||
case 60:
|
case 60:
|
||||||
this.cliBuffer += '<';
|
this.cliBuffer += '<';
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
module.exports = function(config) {
|
module.exports = function(config) {
|
||||||
config.set({
|
config.set({
|
||||||
basePath: '../../',
|
basePath: '../',
|
||||||
frameworks: ['mocha', 'chai', 'sinon-chai'],
|
frameworks: ['mocha', 'chai', 'sinon-chai'],
|
||||||
files: [
|
files: [
|
||||||
'./libraries/jquery-2.1.4.min.js',
|
'./libraries/jquery-2.1.4.min.js',
|
||||||
|
@ -10,9 +10,15 @@ module.exports = function(config) {
|
||||||
'./src/js/localization.js',
|
'./src/js/localization.js',
|
||||||
'./src/js/gui.js',
|
'./src/js/gui.js',
|
||||||
'./src/js/tabs/cli.js',
|
'./src/js/tabs/cli.js',
|
||||||
'./src/test/**/*.js'
|
'./test/**/*.js'
|
||||||
],
|
],
|
||||||
browsers: ['ChromeHeadless'],
|
browsers: ['ChromeHeadlessNoSandbox'],
|
||||||
|
customLaunchers: {
|
||||||
|
ChromeHeadlessNoSandbox: {
|
||||||
|
base: 'ChromeHeadless',
|
||||||
|
flags: ['--no-sandbox']
|
||||||
|
}
|
||||||
|
},
|
||||||
singleRun: true
|
singleRun: true
|
||||||
});
|
});
|
||||||
};
|
};
|
|
@ -39,7 +39,11 @@ describe('TABS.cli', () => {
|
||||||
data: toArrayBuffer('\r\033[Kserialpassthrough\tservo\r\n# ser')
|
data: toArrayBuffer('\r\033[Kserialpassthrough\tservo\r\n# ser')
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(cliOutput.html()).to.equal('<br>serialpassthrough\tservo<br>');
|
// Ambigous auto-complete from firmware is preceded with an \r carriage return
|
||||||
|
const expectedValue = GUI.operating_system === "MacOS" ?
|
||||||
|
'<br>serialpassthrough\tservo<br>' :
|
||||||
|
'serialpassthrough\tservo<br>';
|
||||||
|
expect(cliOutput.html()).to.equal(expectedValue);
|
||||||
expect(cliPrompt.val()).to.equal('ser');
|
expect(cliPrompt.val()).to.equal('ser');
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue