Skip to content

Commit bb928bd

Browse files
committed
Build: Rearrange grunt/npm tasks into a build/dist/test pattern
Ref 76df9e4 Closes jquerygh-1980
1 parent 53aa87f commit bb928bd

File tree

3 files changed

+24
-20
lines changed

3 files changed

+24
-20
lines changed

Gruntfile.js

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ module.exports = function( grunt ) {
121121
},
122122
watch: {
123123
files: [ "<%= jshint.all.src %>" ],
124-
tasks: "dev"
124+
tasks: [ "dev" ]
125125
},
126126
uglify: {
127127
all: {
@@ -154,26 +154,14 @@ module.exports = function( grunt ) {
154154
// Integrate jQuery specific tasks
155155
grunt.loadTasks( "build/tasks" );
156156

157-
grunt.registerTask( "lint", [ "jshint", "jscs" ] );
158-
159-
grunt.registerTask( "node_smoke_test", function() {
160-
var done = this.async();
161-
require( "jsdom" ).env( "", function( errors, window ) {
162-
if ( errors ) {
163-
console.error( errors );
164-
done( false );
165-
}
166-
require( "./" )( window );
167-
done();
168-
});
169-
});
170-
171-
// Short list as a high frequency watch task
172-
grunt.registerTask( "dev", [ "build:*:*", "lint" ] );
157+
grunt.registerTask( "lint", [ "jsonlint", "jshint", "jscs" ] );
173158

174159
grunt.registerTask( "test_fast", [ "node_smoke_test" ] );
175160

176-
grunt.registerTask( "test", [ "default", "test_fast" ] );
161+
grunt.registerTask( "test", [ "test_fast" ] );
162+
163+
// Short list as a high frequency watch task
164+
grunt.registerTask( "dev", [ "build:*:*", "lint", "uglify", "dist:*" ] );
177165

178-
grunt.registerTask( "default", [ "jsonlint", "dev", "uglify", "dist:*", "compare_size" ] );
166+
grunt.registerTask( "default", [ "dev", "test_fast", "compare_size" ] );
179167
};

build/tasks/node_smoke_test.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module.exports = function( grunt ) {
2+
3+
"use strict";
4+
5+
grunt.registerTask( "node_smoke_test", function() {
6+
var done = this.async();
7+
require( "jsdom" ).env( "", function( errors, window ) {
8+
if ( errors ) {
9+
console.error( errors );
10+
done( false );
11+
}
12+
require( "../.." )( window );
13+
done();
14+
});
15+
});
16+
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"scripts": {
5656
"build": "npm install && grunt",
5757
"start": "grunt watch",
58-
"test": "grunt test"
58+
"test": "grunt && grunt test"
5959
},
6060
"commitplease": {
6161
"components": [

0 commit comments

Comments
 (0)