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:
authorfreezy <marek.viger@gmail.com>2015-08-27 20:55:43 +0300
committerfreezy <marek.viger@gmail.com>2015-08-27 20:55:43 +0300
commitbec72c2d4d7fa20fcacad9be4846fb9c7e4aef9e (patch)
tree3fc11c94b54c226fc7307f7a84d4c8a108c55ec9 /test
parente9e57f8606baa53743e1e54cfa88f187e744000d (diff)
Relaxerror can be defined as object of error IDs and filepath masks
Diffstat (limited to 'test')
-rw-r--r--test/bootlint_test.js8
-rw-r--r--test/fixtures/missing-jquery.html24
2 files changed, 29 insertions, 3 deletions
diff --git a/test/bootlint_test.js b/test/bootlint_test.js
index f907305..e3f0317 100644
--- a/test/bootlint_test.js
+++ b/test/bootlint_test.js
@@ -37,13 +37,13 @@ exports.bootlint = {
'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("8 lint error(s) found across 4 file(s)") >= 0,
+ test.ok(result.stdout.indexOf("9 lint error(s) found across 5 file(s)") >= 0,
'Should print number of lint errors and files');
test.done();
});
},
relaxerror: function(test) {
- test.expect(3);
+ test.expect(4);
grunt.util.spawn({
grunt: true,
args: ['bootlint:relaxerror', '--no-color'],
@@ -52,7 +52,9 @@ exports.bootlint = {
'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,
+ test.ok(result.stdout.indexOf("W005") === -1,
+ 'Should not warn about missing jQuery');
+ test.ok(result.stdout.indexOf("1 lint error(s) found across 3 file(s)") >= 0,
'Should print correct number of lint errors and files');
test.done();
});
diff --git a/test/fixtures/missing-jquery.html b/test/fixtures/missing-jquery.html
new file mode 100644
index 0000000..1529a75
--- /dev/null
+++ b/test/fixtures/missing-jquery.html
@@ -0,0 +1,24 @@
+<!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]-->
+
+ <link rel="stylesheet" href="../../lib/qunit-1.14.0.css">
+ <script src="../../lib/qunit-1.14.0.js"></script>
+ <script src="../../../dist/browser/bootlint.js"></script>
+ <script src="../generic-qunit.js"></script>
+ </head>
+ <body>
+ <div id="qunit"></div>
+ <ol id="bootlint">
+ <li data-lint="Document is missing a jQuery"></li>
+ </ol>
+ </body>
+</html>