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:
authorXhmikosR <xhmikosr@gmail.com>2015-11-16 18:56:08 +0300
committerXhmikosR <xhmikosr@gmail.com>2015-11-18 23:05:40 +0300
commitf553832f830447f636cb701a1dfca64411348274 (patch)
tree0fdb73dafeaed4f182f9f503010a82f2181c6477 /test
parentbca08873b0003882cb8f9a6be11765e8e268d816 (diff)
Lint tweaks.
Diffstat (limited to 'test')
-rw-r--r--test/bootlint_test.js52
1 files changed, 24 insertions, 28 deletions
diff --git a/test/bootlint_test.js b/test/bootlint_test.js
index eaccdc5..c5667f3 100644
--- a/test/bootlint_test.js
+++ b/test/bootlint_test.js
@@ -23,21 +23,17 @@ var grunt = require('grunt');
*/
exports.bootlint = {
- setUp: function(done) {
- // setup here if necessary
- done();
- },
- default_options: function(test) {
+ defaultOptions: function(test) {
test.expect(3);
grunt.util.spawn({
grunt: true,
- args: ['bootlint:default_options', '--no-color'],
+ args: ['bootlint:defaultOptions', '--no-color']
}, function(err, result) {
- test.ok(result.stdout.indexOf("test/fixtures/missing-doctype.html") >= 0,
+ 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,
+ test.ok(result.stdout.indexOf('Document is missing a DOCTYPE declaration') >= 0,
'Should warn about missing a DOCTYPE');
- test.ok(result.stdout.indexOf("9 lint error(s) found across 5 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();
});
@@ -46,15 +42,15 @@ exports.bootlint = {
test.expect(4);
grunt.util.spawn({
grunt: true,
- args: ['bootlint:relaxerror', '--no-color'],
+ args: ['bootlint:relaxerror', '--no-color']
}, function(err, result) {
- test.ok(result.stdout.indexOf("E001") === -1,
+ test.ok(result.stdout.indexOf('E001') === -1,
'Should not warn about missing a DOCTYPE');
- test.ok(result.stdout.indexOf("W001") >= 0,
+ test.ok(result.stdout.indexOf('W001') >= 0,
'Should warn about missing charset');
- test.ok(result.stdout.indexOf("W005") === -1,
+ 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,
+ 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();
});
@@ -63,11 +59,11 @@ exports.bootlint = {
test.expect(2);
grunt.util.spawn({
grunt: true,
- args: ['bootlint:stoponerror', '--no-color'],
+ args: ['bootlint:stoponerror', '--no-color']
}, function(err, result) {
- test.ok(result.stdout.indexOf("E001") >= 0,
+ test.ok(result.stdout.indexOf('E001') >= 0,
'Should warn about missing a DOCTYPE');
- test.ok(result.stdout.indexOf("W001") === -1,
+ test.ok(result.stdout.indexOf('W001') === -1,
'Should not warn about anything after E001');
test.done();
});
@@ -76,13 +72,13 @@ exports.bootlint = {
test.expect(3);
grunt.util.spawn({
grunt: true,
- args: ['bootlint:stoponwarning', '--no-color'],
+ args: ['bootlint:stoponwarning', '--no-color']
}, function(err, result) {
- test.ok(result.stdout.indexOf("E001") >= 0,
+ test.ok(result.stdout.indexOf('E001') >= 0,
'Should display error of missing a DOCTYPE');
- test.ok(result.stdout.indexOf("W001") >= 0,
+ test.ok(result.stdout.indexOf('W001') >= 0,
'Should warn about W001');
- test.ok(result.stdout.indexOf("E029") === -1,
+ test.ok(result.stdout.indexOf('E029') === -1,
'Should not warn about anything after W001');
test.done();
});
@@ -91,9 +87,9 @@ exports.bootlint = {
test.expect(1);
grunt.util.spawn({
grunt: true,
- args: ['bootlint:stoponboth', '--no-color'],
+ args: ['bootlint:stoponboth', '--no-color']
}, function(err, result) {
- test.ok(result.stdout.indexOf("E001") === -1,
+ test.ok(result.stdout.indexOf('E001') === -1,
'Should not warn about E001');
test.done();
});
@@ -102,9 +98,9 @@ exports.bootlint = {
test.expect(1);
grunt.util.spawn({
grunt: true,
- args: ['bootlint:showallerrors', '--no-color'],
+ args: ['bootlint:showallerrors', '--no-color']
}, function(err, result) {
- test.ok(result.stdout.indexOf("8 lint error(s) found across 3 file(s). Use --force to continue.") >= 0,
+ test.ok(result.stdout.indexOf('8 lint error(s) found across 3 file(s). Use --force to continue.') >= 0,
'Should show all errors before hard fail.');
test.done();
});
@@ -113,9 +109,9 @@ exports.bootlint = {
test.expect(1);
grunt.util.spawn({
grunt: true,
- args: ['bootlint:showallerrorswithstop', '--no-color'],
+ args: ['bootlint:showallerrorswithstop', '--no-color']
}, function(err, result) {
- test.ok(result.stdout.indexOf("8 lint error(s) found across 3 file(s). Use --force to continue.") >= 0,
+ test.ok(result.stdout.indexOf('8 lint error(s) found across 3 file(s). Use --force to continue.') >= 0,
'Should show all errors before hard fail even if stopon* is set.');
test.done();
});
@@ -124,7 +120,7 @@ exports.bootlint = {
test.expect(1);
grunt.util.spawn({
grunt: true,
- args: ['bootlint:pass', '--no-color'],
+ args: ['bootlint:pass', '--no-color']
}, function(err, result) {
test.ok(result.stdout.indexOf('1 file(s) lint free.') >= 0,
'Should print correct number of lint free files');