Adding auto testing
parent
e02f17aebe
commit
9880c1f749
|
@ -0,0 +1,13 @@
|
|||
language: node_js
|
||||
node_js:
|
||||
- "4.4.x"
|
||||
|
||||
sudo: true
|
||||
|
||||
before_script:
|
||||
- npm install -g grunt-cli
|
||||
- npm install
|
||||
- grunt
|
||||
- cd test
|
||||
|
||||
script: phantomjs test.js
|
|
@ -57,6 +57,9 @@ module.exports = function(grunt) {
|
|||
dr: {
|
||||
command: "node node_modules/dr.js/dr dr.json"
|
||||
},
|
||||
test: {
|
||||
command: "cd test; phantomjs test.js"
|
||||
},
|
||||
eslint: {
|
||||
command: "./node_modules/eslint/bin/eslint.js " + core.join(" ")
|
||||
},
|
||||
|
@ -69,4 +72,5 @@ module.exports = function(grunt) {
|
|||
|
||||
grunt.registerTask("default", ["exec:eslint", "concat", "uglify", "exec:dr"]);
|
||||
grunt.registerTask("lint", ["exec:eslint"]);
|
||||
grunt.registerTask("test", ["exec:test"]);
|
||||
};
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
var page = require("webpage").create();
|
||||
|
||||
page.open("test.html", function (status) {
|
||||
var errors = 0;
|
||||
if (status === "success") {
|
||||
errors = page.evaluate(function () {
|
||||
return +document.querySelector("li.failures em").innerText;
|
||||
});
|
||||
console.log(errors);
|
||||
}
|
||||
phantom.exit(errors);
|
||||
});
|
Loading…
Reference in New Issue