aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Gibson <richard.gibson@gmail.com>2014-12-29 21:07:03 -0500
committerRichard Gibson <richard.gibson@gmail.com>2015-01-11 10:28:18 -0500
commitbb928bde7e7b85357fef3fedd450b04c03e965d7 (patch)
treec5f4774e6bbc3547968aaef0044edcec97fcd4d1
parent53aa87f3bf4284763405f3eb8affff296e55ba4f (diff)
downloadjquery-bb928bde7e7b85357fef3fedd450b04c03e965d7.tar.gz
jquery-bb928bde7e7b85357fef3fedd450b04c03e965d7.zip
Build: Rearrange grunt/npm tasks into a build/dist/test pattern
Ref 76df9e4e389d80bff410a9e5f08b848de1d21a2f Closes gh-1980
-rw-r--r--Gruntfile.js26
-rw-r--r--build/tasks/node_smoke_test.js16
-rw-r--r--package.json2
3 files changed, 24 insertions, 20 deletions
diff --git a/Gruntfile.js b/Gruntfile.js
index 705e093d8..38e5d4661 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -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
index 000000000..f39872521
--- /dev/null
+++ b/build/tasks/node_smoke_test.js
@@ -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();
+ });
+ });
+};
diff --git a/package.json b/package.json
index 39d3cde34..2d6544d04 100644
--- a/package.json
+++ b/package.json
@@ -55,7 +55,7 @@
"scripts": {
"build": "npm install && grunt",
"start": "grunt watch",
- "test": "grunt test"
+ "test": "grunt && grunt test"
},
"commitplease": {
"components": [