Add lint tests
authorkangax <kangax@gmail.com>
Tue, 2 Apr 2013 12:29:38 +0000 (14:29 +0200)
committerkangax <kangax@gmail.com>
Tue, 2 Apr 2013 12:33:18 +0000 (14:33 +0200)
test.js
tests/lint.js

diff --git a/test.js b/test.js
index 992e8a3..7aaa783 100644 (file)
--- 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){
index 3c411b4..2ef0ccd 100644 (file)
@@ -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');
   });
 
   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);