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-10 18:40:12 +0300
committerZac Echola <zac.echola@so.mnscu.edu>2014-11-10 18:40:12 +0300
commite8b2a461077e8c43c094712dda17b0128c8ff529 (patch)
tree1881b4cc5b9d5af86eaca9b481d74d8910cf2e48 /test
parent792bb692eb6ac5e5b4ea0bc1624a2890ec5ff270 (diff)
Bumps dependency, adding line/column nums
Also cleans up quite a bit of the noisiness from the output. It will now pass silently and will only print when there are warnings or errors.
Diffstat (limited to 'test')
-rw-r--r--test/bootlint_test.js25
-rw-r--r--test/fixtures/cols-redundant.html51
2 files changed, 57 insertions, 19 deletions
diff --git a/test/bootlint_test.js b/test/bootlint_test.js
index 466b2b4..0a5a781 100644
--- a/test/bootlint_test.js
+++ b/test/bootlint_test.js
@@ -28,19 +28,17 @@ exports.bootlint = {
done();
},
default_options: function(test) {
- test.expect(4);
+ test.expect(3);
grunt.util.spawn({
grunt: true,
args: ['bootlint:default_options', '--no-color'],
}, function(err, result) {
- test.ok(result.stdout.indexOf("Validation started for") >= 0,
- 'Should print start msg');
test.ok(result.stdout.indexOf("test/fixtures/missing-doctype.html") >= 0,
'Should print file path');
test.ok(result.stdout.indexOf("Document is missing a DOCTYPE declaration") >= 0,
'Should warn about missing a DOCTYPE');
- test.ok(result.stdout.indexOf("2 lint errors found") >= 0,
- 'Should print number of lint errors');
+ test.ok(result.stdout.indexOf("8 lint error(s) found across 4 file(s)") >= 0,
+ 'Should print number of lint errors and files');
test.done();
});
},
@@ -52,20 +50,9 @@ exports.bootlint = {
}, function(err, result) {
test.ok(result.stdout.indexOf("Document is missing a DOCTYPE declaration") === -1,
'Should not warn about missing a DOCTYPE');
- test.ok(result.stdout.indexOf("1 lint errors found") >= 0,
- 'Should print correct number of lint errors');
+ 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();
});
- },
- pass: function(test) {
- test.expect(1);
- grunt.util.spawn({
- grunt: true,
- args: ['bootlint:pass', '--no-color'],
- }, function(err, result) {
- test.ok(result.stdout.indexOf("No Bootlint errors!") >= 0,
- 'Should print "No Bootlint errors!" message');
- test.done();
- });
- },
+ }
};
diff --git a/test/fixtures/cols-redundant.html b/test/fixtures/cols-redundant.html
new file mode 100644
index 0000000..d7d3acc
--- /dev/null
+++ b/test/fixtures/cols-redundant.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8" />
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <title>Test</title>
+ <!--[if lt IE 9]>
+ <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
+ <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
+ <![endif]-->
+ <script src="../../lib/jquery.min.js"></script>
+
+ <link rel="stylesheet" href="../../lib/qunit.css">
+ <script src="../../lib/qunit.js"></script>
+ <script src="../../../dist/browser/bootlint.js"></script>
+ <script src="../generic-qunit.js"></script>
+ </head>
+ <body>
+ <div class="container">
+ <div class="row">
+ <div class="abc col-xs-2 def col-sm-1 ghi col-md-1 jkl col-lg-1">Single-digit columns; sm-lg redundant; random classes interleaved</div>
+ </div>
+ <div class="row">
+ <div class="col-xs-10 abc col-sm-10 def col-md-10 ghi col-lg-12 jkl">Double-digit columns; xs-md redundant; random classes interleaved</div>
+ </div>
+ <div class="row">
+ <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">xs-lg redundant</div>
+ </div>
+ <div class="row">
+ <div class="col-xs-5 col-sm-5">xs-sm redundant</div>
+ </div>
+ <div class="row">
+ <div class="col-sm-4 col-md-4">sm-md redundant</div>
+ </div>
+ <div class="row">
+ <div class="col-md-3 col-lg-3">md-lg redundant</div>
+ </div>
+ </div>
+
+ <div id="qunit"></div>
+ <ol id="bootlint">
+ <li data-lint='Since grid classes apply to devices with screen widths greater than or equal to the breakpoint sizes (unless overridden by grid classes targeting larger screens), `class="abc col-xs-2 def col-sm-1 ghi col-md-1 jkl col-lg-1"` is redundant and can be simplified to `class="abc def ghi jkl col-xs-2 col-sm-1"`'></li>
+ <li data-lint='Since grid classes apply to devices with screen widths greater than or equal to the breakpoint sizes (unless overridden by grid classes targeting larger screens), `class="col-xs-10 abc col-sm-10 def col-md-10 ghi col-lg-12 jkl"` is redundant and can be simplified to `class="abc def ghi jkl col-xs-10 col-lg-12"`'></li>
+ <li data-lint='Since grid classes apply to devices with screen widths greater than or equal to the breakpoint sizes (unless overridden by grid classes targeting larger screens), `class="col-xs-6 col-sm-6 col-md-6 col-lg-6"` is redundant and can be simplified to `class="col-xs-6"`'></li>
+ <li data-lint='Since grid classes apply to devices with screen widths greater than or equal to the breakpoint sizes (unless overridden by grid classes targeting larger screens), `class="col-xs-5 col-sm-5"` is redundant and can be simplified to `class="col-xs-5"`'></li>
+ <li data-lint='Since grid classes apply to devices with screen widths greater than or equal to the breakpoint sizes (unless overridden by grid classes targeting larger screens), `class="col-sm-4 col-md-4"` is redundant and can be simplified to `class="col-sm-4"`'></li>
+ <li data-lint='Since grid classes apply to devices with screen widths greater than or equal to the breakpoint sizes (unless overridden by grid classes targeting larger screens), `class="col-md-3 col-lg-3"` is redundant and can be simplified to `class="col-md-3"`'></li>
+ </ol>
+ </body>
+</html>