Home page Forum Wiki Mail Jabber Devel NIX-FILES

AltLUG Git

Git-repositories of Altai Linux User Group

Lint and test addons
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Sun, 22 Apr 2012 10:46:56 +0000 (12:46 +0200)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Sun, 22 Apr 2012 10:46:56 +0000 (12:46 +0200)
addons/close-enough/qunit-close-enough.js
addons/composite/qunit-composite.js
addons/junitlogger/junitlogger.js
addons/step/qunit-step.js
addons/step/step.html
grunt.js

index 56ca694..ddb5a58 100644 (file)
@@ -14,9 +14,9 @@ QUnit.extend( QUnit, {
                var passes = (actual === expected) || Math.abs(actual - expected) <= maxDifference;
                QUnit.push(passes, actual, expected, message);
        },
-       
+
        /**
-        * Checks that the first two arguments are numbers with differences greater than the specified 
+        * Checks that the first two arguments are numbers with differences greater than the specified
         * minimum difference.
         *
         * @example notClose(3.1, Math.PI, 0.001);
index 44421e3..89c47eb 100644 (file)
@@ -88,7 +88,7 @@ QUnit.testDone(function() {
 
        QUnit.addEvent(current, "dblclick", function( e ) {
                var target = e && e.target ? e.target : window.event.srcElement;
-               if ( target.nodeName.toLowerCase() == "span" || target.nodeName.toLowerCase() == "b" ) {
+               if ( target.nodeName.toLowerCase() === "span" || target.nodeName.toLowerCase() === "b" ) {
                        target = target.parentNode;
                }
                if ( window.location && target.nodeName.toLowerCase() === "strong" ) {
index 96b10bf..dde4707 100644 (file)
        });
 
        function XmlWriter(settings) {
-               var data = [], stack = [], lineBreakAt;
-
-               settings = settings || {};
-               lineBreakAt = makeMap(settings.linebreak_at || 'mytag');
-
                function addLineBreak(name) {
                        if (lineBreakAt[name] && data[data.length - 1] !== '\n') {
                                data.push('\n');
 
                        items = items || [];
 
-                       if (typeof(items) == "string") {
+                       if (typeof(items) === "string") {
                                items = items.split(',');
                        }
 
                        });
                }
 
+               var data = [], stack = [], lineBreakAt;
+
+               settings = settings || {};
+               lineBreakAt = makeMap(settings.linebreak_at || 'mytag');
+
                this.start = function(name, attrs, empty) {
                        if (!empty) {
                                stack.push(name);
index 25ce573..1ed3ff0 100644 (file)
@@ -9,7 +9,7 @@ QUnit.extend( QUnit, {
         */
        step: function (expected, message) {
                this.config.current.step++; // increment internal step counter.
-               if (typeof message == "undefined") {
+               if (typeof message === "undefined") {
                        message = "step " + expected;
                }
                var actual = this.config.current.step;
@@ -19,7 +19,7 @@ QUnit.extend( QUnit, {
 
 /**
  * Reset the step counter for every test()
- */ 
+ */
 QUnit.testStart(function () {
        this.config.current.step = 0;
 });
index abeb655..95ba492 100644 (file)
@@ -10,6 +10,5 @@
 </head>
 <body>
        <div id="qunit"></div>
-       <canvas id="qunit-canvas" width="5" height="5"></canvas>
 </body>
 </html>
index fbe9c70..27ab218 100644 (file)
--- a/grunt.js
+++ b/grunt.js
@@ -44,10 +44,29 @@ grunt.initConfig({
                        }
                },
                addons: {
-                       // meh
                        options: {
+                               browser: true,
+                               curly: true,
+                               eqnull: true,
+                               eqeqeq: true,
+                               expr: true,
+                               evil: true,
+                               jquery: true,
+                               latedef: true,
+                               noarg: true,
                                onevar: true,
-                               smarttabs: true
+                               smarttabs: true,
+                               trailing: true,
+                               undef: true
+                       },
+                       globals: {
+                               module: true,
+                               test: true,
+                               asyncTest: true,
+                               expect: true,
+                               start: true,
+                               stop: true,
+                               QUnit: true
                        }
                },
                tests: {

Hosting is provided AltSPAHow to use Git
Please direct any questions on jabber alex.wolf@jabber.ru

Valid HTML 4.0 Transitional Valid CSS!

Designer Alexander Wolf