Skip to content

Commit

Permalink
Merge pull request #276 from null-a/phantomjs
Browse files Browse the repository at this point in the history
Run browser tests in phantomjs on Travis.
  • Loading branch information
stuhlmueller committed Dec 3, 2015
2 parents 38955f5 + 3750d82 commit 1e1e99d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,24 @@ node_js:
- "4"
- "5"

env:
- TASK=default

matrix:
include:
- node_js: "5"
env: TASK=travis-phantomjs

install:
- npm install
- npm install -g nodeunit grunt-cli
- if [ $TASK = travis-phantomjs ]; then npm install -g browserify uglifyjs; fi

script:
- grunt
- grunt $TASK

sudo: false
sudo: required
dist: trusty

notifications:
slack: cocolab-stanford:X2Ebs0qIMVUidJBD1xZd2XU1
11 changes: 11 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ module.exports = function(grunt) {
grunt.registerTask('lint', ['gjslint']);
grunt.registerTask('hint', ['jshint']);
grunt.registerTask('fixstyle', ['fixjsstyle']);
grunt.registerTask('travis-phantomjs', ['compile', 'test-phantomjs']);

grunt.registerTask('compile', 'Compile for the browser', function() {
var pkgArg = '';
Expand All @@ -95,4 +96,14 @@ module.exports = function(grunt) {
grunt.registerTask('test-browser', function() {
open('tests/browser/index.html', process.env.BROWSER);
});

grunt.registerTask('test-phantomjs', function() {
try {
var output = execSync('phantomjs node_modules/qunit-phantomjs-runner/runner-list.js tests/browser/index.html');
grunt.log.writeln(output);
} catch (e) {
grunt.log.writeln(e.output.join('\n'));
throw e;
}
});
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"grunt-gjslint": "^0.2.0",
"nodeunit": "^0.9.1",
"open": "0.0.5",
"qunit-phantomjs-runner": "^2.1.0",
"through2": "^2.0.0"
},
"scripts": {
Expand Down

0 comments on commit 1e1e99d

Please sign in to comment.