Permalink
Browse files

example test

  • Loading branch information...
thomasdavis committed Jul 26, 2012
1 parent d3e608e commit 4c4ac185e8d9d5e8ea9ea49163dad560f77ff83c
Showing with 19 additions and 0 deletions.
  1. +19 −0 README.md
View
@@ -27,7 +27,26 @@ var results = w3cjs.validate({
});
```
+## Example async testing with Mocha
+```js
+var w3cjs = require('w3cjs');
+describe('html validation', function(){
+ it('index page should have no html errors', function(done){
+ w3cjs.validate({
+ file: 'index.html',
+ callback: function (res) {
+ console.log(res);
+ if (res.messages.length > 0 ) {
+ throw {error: 'html errors have been found', results: res};
+ };
+ done();
+ }
+ })
+ })
+})
+
+```

0 comments on commit 4c4ac18

Please sign in to comment.