]> source.dussan.org Git - jquery.git/commitdiff
Build: Rearrange grunt/npm tasks into a build/dist/test pattern
authorRichard Gibson <richard.gibson@gmail.com>
Tue, 30 Dec 2014 02:07:03 +0000 (21:07 -0500)
committerRichard Gibson <richard.gibson@gmail.com>
Sun, 11 Jan 2015 15:28:18 +0000 (10:28 -0500)
Ref 76df9e4e389d80bff410a9e5f08b848de1d21a2f
Closes gh-1980

Gruntfile.js
build/tasks/node_smoke_test.js [new file with mode: 0644]
package.json

index 705e093d845d42a4ec8663feea0063aaca288324..38e5d4661d3a4dc64ee5f43c771dd8cce0cab8da 100644 (file)
@@ -121,7 +121,7 @@ module.exports = function( grunt ) {
                },
                watch: {
                        files: [ "<%= jshint.all.src %>" ],
-                       tasks: "dev"
+                       tasks: [ "dev" ]
                },
                uglify: {
                        all: {
@@ -154,26 +154,14 @@ module.exports = function( grunt ) {
        // Integrate jQuery specific tasks
        grunt.loadTasks( "build/tasks" );
 
-       grunt.registerTask( "lint", [ "jshint", "jscs" ] );
-
-       grunt.registerTask( "node_smoke_test", function() {
-           var done = this.async();
-               require( "jsdom" ).env( "", function( errors, window ) {
-                       if ( errors ) {
-                               console.error( errors );
-                               done( false );
-                       }
-                       require( "./" )( window );
-                       done();
-               });
-       });
-
-       // Short list as a high frequency watch task
-       grunt.registerTask( "dev", [ "build:*:*", "lint" ] );
+       grunt.registerTask( "lint", [ "jsonlint", "jshint", "jscs" ] );
 
        grunt.registerTask( "test_fast", [ "node_smoke_test" ] );
 
-       grunt.registerTask( "test", [ "default", "test_fast" ] );
+       grunt.registerTask( "test", [ "test_fast" ] );
+
+       // Short list as a high frequency watch task
+       grunt.registerTask( "dev", [ "build:*:*", "lint", "uglify", "dist:*" ] );
 
-       grunt.registerTask( "default", [ "jsonlint", "dev", "uglify", "dist:*", "compare_size" ] );
+       grunt.registerTask( "default", [ "dev", "test_fast", "compare_size" ] );
 };
diff --git a/build/tasks/node_smoke_test.js b/build/tasks/node_smoke_test.js
new file mode 100644 (file)
index 0000000..f398725
--- /dev/null
@@ -0,0 +1,16 @@
+module.exports = function( grunt ) {
+
+       "use strict";
+
+       grunt.registerTask( "node_smoke_test", function() {
+           var done = this.async();
+               require( "jsdom" ).env( "", function( errors, window ) {
+                       if ( errors ) {
+                               console.error( errors );
+                               done( false );
+                       }
+                       require( "../.." )( window );
+                       done();
+               });
+       });
+};
index 39d3cde3493165a3b0b4adf675b0649fd1ba0465..2d6544d042de53773279b627b9bad279fa0e591b 100644 (file)
@@ -55,7 +55,7 @@
   "scripts": {
     "build": "npm install && grunt",
     "start": "grunt watch",
-    "test": "grunt test"
+    "test": "grunt && grunt test"
   },
   "commitplease": {
     "components": [