grunt-xml-validator
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -29,6 +29,6 @@ /* | ||
valid: { | ||
src: [ 'test/fixtures/example_ok.xml' ] | ||
src: [ 'test/fixtures/example_ok.xml' ] | ||
}, | ||
invalid: { | ||
src: [ 'test/fixtures/example_fail.xml' ] | ||
src: [ 'test/fixtures/example_fail.xml' ] | ||
} | ||
@@ -53,3 +53,3 @@ }, | ||
// plugin's task(s), then test the result. | ||
grunt.registerTask('test', ['nodeunit']); | ||
grunt.registerTask('test', ['jshint', 'nodeunit']); | ||
@@ -56,0 +56,0 @@ // By default, lint and run all tests. |
{ | ||
"name": "grunt-xml-validator", | ||
"description": "Grunt plugin to validate XML files", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"homepage": "https://github.com/kajyr/grunt-xml-validator", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -5,2 +5,4 @@ # grunt-xml-validator | ||
[![Build Status](https://travis-ci.org/kajyr/grunt-xml-validator.svg)](https://travis-ci.org/kajyr/grunt-xml-validator) | ||
## Getting Started | ||
@@ -37,4 +39,7 @@ This plugin requires Grunt `~0.4.4` | ||
## Release History | ||
1.1.1 - Shows failing files or count of valid files | ||
1.1.0 - Removed libxmljs due to incompatibility with Windows. Moved to xmldom. | ||
1.0.0 - let's give it a try :) |
@@ -23,8 +23,8 @@ /* | ||
var xml = grunt.file.read(f); | ||
var doc = new DOMParser({ | ||
locator:{}, | ||
errorHandler: function(level, msg) { | ||
fail = true | ||
} | ||
locator:{}, | ||
errorHandler: function(level, msg) { | ||
fail = true; | ||
grunt.log.error(f + "\tnot valid"); | ||
} | ||
}).parseFromString(xml,'text/xml'); | ||
@@ -36,5 +36,5 @@ | ||
if (fail) { | ||
grunt.fail.warn('Some fail are not valid'); | ||
grunt.fail.warn('Some files are not valid'); | ||
} else { | ||
grunt.log.ok('Files valid'); | ||
grunt.log.ok(this.filesSrc.length + ' files valid'); | ||
} | ||
@@ -41,0 +41,0 @@ |
@@ -35,21 +35,21 @@ 'use strict'; | ||
exec('grunt xml_validator:valid', function(error, stdout) { | ||
var success = error === null; | ||
test.ok(success, 'Valid xml files are considered valid'); | ||
test.done(); | ||
}); | ||
exec('grunt xml_validator:valid', function(error, stdout) { | ||
var success = error === null; | ||
test.ok(success, 'Valid xml files are considered valid'); | ||
test.done(); | ||
}); | ||
}, | ||
invalid: function(test) { | ||
}, | ||
invalid: function(test) { | ||
test.expect(1); | ||
exec('grunt xml_validator:invalid', function(error, stdout) { | ||
var success = error !== null; | ||
test.ok(success, 'Invalid xml files are not considered invalid'); | ||
test.done(); | ||
exec('grunt xml_validator:invalid', function(error, stdout) { | ||
var success = error !== null; | ||
test.ok(success, 'Invalid xml files are not considered invalid'); | ||
test.done(); | ||
}); | ||
}); | ||
} | ||
}; |
7860
12
119
43