I started with the answer from Odi and moved to gulp to get it working. If you specify node_js as your language in your travis file, travis will automatically run
npm install
followed by
npm test
The first will install any devDependencies specified in a package.json file, the second will run the script named "test" also from package.json. Below you'll find the three files I needed to have in the top level of my repo for travis to run a single qunit suite.
.travis.yml
language: node_js
node_js:
- "0.10"
gulpfile.js
var gulp = require('gulp'),
qunit = require('gulp-qunit');
gulp.task('default', function() {
return gulp.src('./tests/unit/unittests_nupic-js.html')
.pipe(qunit());
});
package.json
{
"name": "nupic-js",
"version": "0.0.1",
"description": "JavaScript port of NuPIC",
"license": "GPL-3.0",
"repository": "iandanforth/nupic-js",
"bugs": { "url" : "http://github.com/iandanforth/nupic-js/issues"
},
"author": {
"name": "Ian Danforth",
"email": "[email protected]"
},
"engines": {
"node": ">=0.10.0"
},
"scripts": {
"test": "gulp"
},
"keywords": [
"numenta",
"nupic",
"machine learning"
],
"devDependencies": {
"gulp-qunit": "~0.2.1",
"gulp-util": "~2.2.14",
"gulp": "~3.5.1"
}
}
grunt
as adevDependency
in the package.json file, eliminate the need for the before_script part? – Rosinski