Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/grunt-bootlint.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorZac Echola <zac.echola@so.mnscu.edu>2014-11-14 23:51:46 +0300
committerZac Echola <zac.echola@so.mnscu.edu>2014-11-14 23:51:46 +0300
commit597c723490ca8652a7193b63a33bd9142d1c1bda (patch)
tree994ff32212a05a2f020d7d6c18c440d9709b0298 /test
parent4304977365e7d092cc540dd557e66c25847440b9 (diff)
add stoponwarning option
Diffstat (limited to 'test')
-rw-r--r--test/bootlint_test.js49
1 files changed, 45 insertions, 4 deletions
diff --git a/test/bootlint_test.js b/test/bootlint_test.js
index 73ebeb5..9e0f07b 100644
--- a/test/bootlint_test.js
+++ b/test/bootlint_test.js
@@ -42,19 +42,60 @@ exports.bootlint = {
test.done();
});
},
- custom_options: function(test) {
- test.expect(2);
+ relaxerror: function(test) {
+ test.expect(3);
grunt.util.spawn({
grunt: true,
- args: ['bootlint:custom_options', '--no-color'],
+ args: ['bootlint:relaxerror', '--no-color'],
}, function(err, result) {
- test.ok(result.stdout.indexOf("Document is missing a DOCTYPE declaration") === -1,
+ test.ok(result.stdout.indexOf("E001") === -1,
'Should not warn about missing a DOCTYPE');
+ test.ok(result.stdout.indexOf("W001") >= 0,
+ 'Should warn about missing charset');
test.ok(result.stdout.indexOf("1 lint error(s) found across 2 file(s)") >= 0,
'Should print correct number of lint errors and files');
test.done();
});
},
+ stoponerror: function(test) {
+ test.expect(2);
+ grunt.util.spawn({
+ grunt: true,
+ args: ['bootlint:stoponerror', '--no-color'],
+ }, function(err, result) {
+ test.ok(result.stdout.indexOf("E001") >= 0,
+ 'Should warn about missing a DOCTYPE');
+ test.ok(result.stdout.indexOf("W001") === -1,
+ 'Should not warn about anything after E001');
+ test.done();
+ });
+ },
+ stoponwarning: function(test) {
+ test.expect(3);
+ grunt.util.spawn({
+ grunt: true,
+ args: ['bootlint:stoponwarning', '--no-color'],
+ }, function(err, result) {
+ test.ok(result.stdout.indexOf("E001") >= 0,
+ 'Should display error of missing a DOCTYPE');
+ test.ok(result.stdout.indexOf("W001") >= 0,
+ 'Should warn about W001');
+ test.ok(result.stdout.indexOf("E029") === -1,
+ 'Should not warn about anything after W001');
+ test.done();
+ });
+ },
+ stoponboth: function(test) {
+ test.expect(1);
+ grunt.util.spawn({
+ grunt: true,
+ args: ['bootlint:stoponboth', '--no-color'],
+ }, function(err, result) {
+ test.ok(result.stdout.indexOf("E001") === -1,
+ 'Should not warn about E001');
+ test.done();
+ });
+ },
pass: function(test) {
test.expect(1);
grunt.util.spawn({