aboutsummaryrefslogtreecommitdiffstats
path: root/build/tasks/install_old_jsdom.js
diff options
context:
space:
mode:
Diffstat (limited to 'build/tasks/install_old_jsdom.js')
-rw-r--r--build/tasks/install_old_jsdom.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/build/tasks/install_old_jsdom.js b/build/tasks/install_old_jsdom.js
new file mode 100644
index 000000000..271e0cbe0
--- /dev/null
+++ b/build/tasks/install_old_jsdom.js
@@ -0,0 +1,20 @@
+module.exports = function( grunt ) {
+
+ "use strict";
+
+ // Run this task to run jsdom-related tests on Node.js < 1.0.0.
+ grunt.registerTask( "old_jsdom", function() {
+ if ( !/^v0/.test( process.version ) ) {
+ console.warn( "The old_jsdom task doesn\'t need to be run in io.js or new Node.js" );
+ return;
+ }
+
+ // Use npm on the command-line
+ // There is no local npm
+ grunt.util.spawn( {
+ cmd: "npm",
+ args: [ "install", "jsdom@3" ],
+ opts: { stdio: "inherit" }
+ }, this.async() );
+ } );
+};