diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..cd6743a --- /dev/null +++ b/.travis.yml @@ -0,0 +1,11 @@ +--- +language: node_js +node_js: +- '0.10' +env: + global: + - secure: "eW41gIqOizwO4pTgWnAAbW75AP7F+CK9qfSed/fSh4sJ9HWMIY1YRIaY8gjr+6jV/f7XVHcXuym6ZxgINYSkVKbF1JKxBJNLOXtSgNbVHSic58pYFvUjwxIBI9aPig9uux1+DbnpWqXFDTcACJSevQZE0xwmjdrSkDLgB0G34v8=" + - secure: "Y2Av+Gd3z9uQEB36GwdOOuGka0hx0/HeitASEo59z934O8RxnmN9eNTXS7dDT3XtKtwxIyLTOEpS7qlRdWahH28hr/dS4xJj6ao58C+1xMcDs6NAPGmDxUlcJWpcGEsnjmXjQCc3fBioSTdpIBrK/gdvgpNh77UKG74Sk7Z+YGk=" +before_script: +- npm install -g grunt-cli +- curl https://gist.github.com/santiycr/5139565/raw/sauce_connect_setup.sh | bash diff --git a/Gruntfile.js b/Gruntfile.js index cef2430..38a31de 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -93,6 +93,7 @@ module.exports = function(grunt) { // Default task. grunt.registerTask('build', ['concat', 'uglify']); - grunt.registerTask('default', ['jshint', 'concat', 'qunit', 'uglify', 'webdriver']); + grunt.registerTask('default', ['jshint', 'concat', 'qunit', 'uglify']); + grunt.registerTask('travis', ['jshint', 'concat', 'qunit', 'uglify', 'webdriver']); }; diff --git a/package.json b/package.json index 2752a68..e50e960 100644 --- a/package.json +++ b/package.json @@ -1,32 +1,35 @@ { - "title": "html2canvas", - "name": "html2canvas", - "description": "Screenshots with JavaScript", - "version": "0.4.0", - "author": { - "name": "Niklas von Hertzen (@niklasvh)" - }, - "engines": { - "node": ">=0.8.0" - }, - "dependencies": { - "base64-arraybuffer": ">= 0.1.0", - "png-js": ">= 0.1.1", - "sync-webdriver": ">=0.1.1", - "express": "~3.2.3", - "baconjs": "~0.3.15" - }, - "devDependencies": { - "grunt": ">=0.4.0", - "grunt-contrib-concat": "*", - "grunt-contrib-uglify": "*", - "grunt-contrib-jshint": "*", - "grunt-contrib-qunit": "*" - }, - "homepage": "http://html2canvas.hertzen.com", - "licenses": [ - { - "type": "MIT" - } - ] + "title": "html2canvas", + "name": "html2canvas", + "description": "Screenshots with JavaScript", + "version": "0.4.0", + "author": { + "name": "Niklas von Hertzen (@niklasvh)" + }, + "engines": { + "node": ">=0.8.0" + }, + "dependencies": { + "base64-arraybuffer": ">= 0.1.0", + "png-js": ">= 0.1.1", + "sync-webdriver": ">=0.1.1", + "express": "~3.2.3", + "baconjs": "~0.3.15" + }, + "devDependencies": { + "grunt": ">=0.4.0", + "grunt-contrib-concat": "*", + "grunt-contrib-uglify": "*", + "grunt-contrib-jshint": "*", + "grunt-contrib-qunit": "*" + }, + "scripts": { + "test": "grunt travis --verbose" + }, + "homepage": "http://html2canvas.hertzen.com", + "licenses": [ + { + "type": "MIT" + } + ] } diff --git a/tests/selenium.js b/tests/selenium.js index c88be68..8e5847e 100644 --- a/tests/selenium.js +++ b/tests/selenium.js @@ -246,12 +246,18 @@ var tests = [], outputImages = false, - results = {}, - testStream = getTests("tests/cases"); + results = {}; + + exports.tests = function() { + var testStream = getTests("tests/cases"); + + testStream.onValue(function(test) { + tests.push(test); + }); + + testStream.onEnd(runWebDriver); + }; - testStream.onValue(function(test) { - tests.push(test); - }); /* if (outputImages) { @@ -261,5 +267,4 @@ } */ - testStream.onEnd(runWebDriver); })(); \ No newline at end of file