From 1933a8d68b1e2ea30effcc5589fed4eef5a61f13 Mon Sep 17 00:00:00 2001 From: kangax Date: Tue, 2 Apr 2013 14:29:38 +0200 Subject: [PATCH] Add lint tests --- test.js | 1 + tests/lint.js | 24 +++++++++++------------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/test.js b/test.js index 992e8a3..7aaa783 100644 --- a/test.js +++ b/test.js @@ -9,6 +9,7 @@ testrunner.run({ code: './src/htmlminifier.js', tests: [ './tests/minifier.js', + './tests/lint.js', ] }, function(err, report) { if(report.failed > 0){ diff --git a/tests/lint.js b/tests/lint.js index 3c411b4..2ef0ccd 100644 --- a/tests/lint.js +++ b/tests/lint.js @@ -1,12 +1,10 @@ (function(global){ - var minify = global.minify, input, output, lint; - - module('', { - setup: function() { + var minify = global.minify || require('../dist/all.js').minify, + HTMLLint = HTMLLint || require('../dist/all.js').HTMLLint, + input, + output, lint = new HTMLLint(); - } - }); test('lint exists', function() { ok(typeof lint !== 'undefined'); @@ -17,11 +15,11 @@ }); test('lint API', function() { - equals(0, lint.log.length, '`log` property exists'); - equals("function", typeof lint.populate, '`populate` method exists'); - equals("function", typeof lint.test, '`test` method exists'); - equals("function", typeof lint.testElement, '`testElement` method exists'); - equals("function", typeof lint.testAttribute, '`testAttribute` method exists'); + equal(0, lint.log.length, '`log` property exists'); + equal("function", typeof lint.populate, '`populate` method exists'); + equal("function", typeof lint.test, '`test` method exists'); + equal("function", typeof lint.testElement, '`testElement` method exists'); + equal("function", typeof lint.testAttribute, '`testAttribute` method exists'); }); test('deprecated element (font)', function(){ @@ -29,7 +27,7 @@ var log = lint.log.join(''); ok(log.indexOf('font') > -1); - ok(log.indexOf('deprecated element') > -1); + ok(log.indexOf('deprecated') > -1); }); -})(this); +})(typeof exports === 'undefined' ? window : exports); -- 2.34.1