Skip to content
This repository has been archived by the owner on Oct 1, 2022. It is now read-only.

Commit

Permalink
changed: switched from PhantomJS to Chrome headless testing
Browse files Browse the repository at this point in the history
  • Loading branch information
MartijnR committed May 26, 2017
1 parent 1d3ed5c commit 80ee9f2
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 33 deletions.
11 changes: 10 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
sudo: false
dist: trusty
language: node_js
node_js:
- "4"
- "6"
addons:
apt:
packages:
- google-chrome-stable
before_script:
- npm install -g grunt-cli
# next 3 lines temporary until google-chrome-stable is 59+
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start &
- sleep 3
37 changes: 16 additions & 21 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@

module.exports = function(grunt) {

require('time-grunt')(grunt);

grunt.initConfig({
grunt.initConfig({

clean: {
dist: {
Expand Down Expand Up @@ -43,28 +41,26 @@ module.exports = function(grunt) {
}
},

karma: {
options: {
singleRun: true,
reporters: ['dots']
},
headless: {
configFile: 'test/karma.conf.js',
browsers: ['PhantomJS']
},
browsers: {
configFile: 'test/karma.conf.js',
browsers: ['Chrome', 'Firefox', 'Safari', 'Opera']
}
}
});
karma: {
options: {
singleRun: true,
reporters: ['dots'],
configFile: 'test/karma.conf.js',
},
headless: {
browsers: ['ChromeHeadless']
},
browsers: {
browsers: ['Chrome', 'Firefox', 'Safari', 'Opera']
}
}
});

grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-peg');
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('time-grunt');
grunt.loadNpmTasks('grunt-karma');

grunt.registerTask('dist', [
'clean:dist',
Expand All @@ -73,4 +69,3 @@ module.exports = function(grunt) {
'uglify:dist'
]);
};

13 changes: 5 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,18 @@
"chai": "2.x.x",
"grunt": "1.0.x",
"grunt-karma": "2.0.x",
"grunt-mocha-test": "0.13.x",
"karma": "1.5.x",
"karma": "1.7.x",
"karma-chai": "0.1.x",
"karma-chrome-launcher": "2.0.x",
"karma-chrome-launcher": "2.1.x",
"karma-firefox-launcher": "1.0.x",
"karma-mocha": "1.3.x",
"karma-opera-launcher": "1.0.x",
"karma-phantomjs-launcher": "1.0.x",
"karma-safari-launcher": "1.0.x",
"mocha": "3.2.x",
"phantomjs-prebuilt": "2.1.x",
"mocha": "3.4.x",
"time-grunt": "1.4.x",
"grunt-contrib-clean": "1.0.x",
"grunt-contrib-clean": "1.1.x",
"grunt-contrib-concat": "1.0.x",
"grunt-contrib-uglify": "2.2.x",
"grunt-contrib-uglify": "3.0.x",
"grunt-peg": "2.0.1"
}
}
5 changes: 2 additions & 3 deletions test/spec/functions-openrosa.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -570,8 +570,7 @@ describe('Custom "OpenRosa" functions', function() {

it('log10()', function() {
[
// note this has a tiny rounding error because Math.log10 is not supported in PhantomJS
['log10(2)', doc, 0.30102999566398114],
['log10(2)', doc, 0.3010299956639812],
['log10("NaN")', doc, NaN],
['log10("a")', doc, NaN],
].forEach(function(t) {
Expand Down Expand Up @@ -723,7 +722,7 @@ describe('Custom "OpenRosa" functions', function() {
expect(test).to.throw(win.Error);
});

it('abs', function(){
it('abs', function() {
[
['abs(10.5)', 10.5],
['abs(-10.5)', 10.5],
Expand Down

0 comments on commit 80ee9f2

Please sign in to comment.