Skip to content

Commit 11dd112

Browse files
committed
Added html testing, travis should fail
1 parent 3db3439 commit 11dd112

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
node_modules/
12
build/output

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"test": "make test"
1010
}
1111
, "devDependencies": {
12-
"mocha": "1.3.0"
12+
"mocha": "1.3.0",
13+
"wc3js": "0.1.4"
1314
}
1415
}

test/sample.js

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1-
var assert = require("assert")
2-
describe('Array', function(){
3-
describe('#indexOf()', function(){
4-
it('should return -1 when the value is not present', function(){
5-
assert.equal(-1, [1,2,3].indexOf(5));
6-
assert.equal(-1, [1,2,3].indexOf(0));
7-
})
1+
var assert = require('assert');
2+
var wc3js = require('wc3js');
3+
describe('html validation', function(){
4+
it('index page should have no html errors', function(done){
5+
wc3js.validate({
6+
file: 'index.html',
7+
callback: function (res) {
8+
console.log(res);
9+
if (res.messages.length > 0 ) {
10+
throw {error: 'html errors have been found', results: res};
11+
};
12+
done();
13+
}
14+
})
815
})
916
})

0 commit comments

Comments
 (0)