aboutsummaryrefslogtreecommitdiffstats
path: root/Gruntfile.js
diff options
context:
space:
mode:
authorMichał Gołębiowski <m.goleb@gmail.com>2014-09-11 15:18:34 -0500
committerMichał Gołębiowski <m.goleb@gmail.com>2014-12-26 13:26:46 +0100
commit76df9e4e389d80bff410a9e5f08b848de1d21a2f (patch)
tree215a453aac2f1cc5574f66173e91d391493146d3 /Gruntfile.js
parentab20d9d24f0a95df382c02e9ef3dcc4adb86e4f1 (diff)
downloadjquery-76df9e4e389d80bff410a9e5f08b848de1d21a2f.tar.gz
jquery-76df9e4e389d80bff410a9e5f08b848de1d21a2f.zip
Build: Don't assume the browser environment; smoke test on Node w/ jsdom
Fixes gh-1950 Closes gh-1949
Diffstat (limited to 'Gruntfile.js')
-rw-r--r--Gruntfile.js17
1 files changed, 16 insertions, 1 deletions
diff --git a/Gruntfile.js b/Gruntfile.js
index 3e9940f1c..aefc54512 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -157,9 +157,24 @@ module.exports = function( grunt ) {
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" ] );
- // Default grunt
+ grunt.registerTask( "test_fast", [ "node_smoke_test" ] );
+
+ grunt.registerTask( "test", [ "default", "test_fast" ] );
+
grunt.registerTask( "default", [ "jsonlint", "dev", "uglify", "dist:*", "compare_size" ] );
};