File tree Expand file tree Collapse file tree 3 files changed +32
-2
lines changed
Expand file tree Collapse file tree 3 files changed +32
-2
lines changed Original file line number Diff line number Diff line change 1+ module . exports = function ( grunt ) {
2+ grunt . registerTask ( "jsdom" , function ( ) {
3+ var current ,
4+ pkg = grunt . config ( "pkg" ) ,
5+ version = pkg . jsdomVersions [
6+
7+ // Unfortunately, this is currently the only
8+ // way to tell the difference between Node and iojs
9+ / ^ v 0 / . test ( process . version ) ? "node" : "iojs"
10+ ] ;
11+
12+ try {
13+ current = require ( "jsdom/package.json" ) . version ;
14+ if ( current === version ) {
15+ return ;
16+ }
17+ } catch ( e ) { }
18+
19+ // Use npm on the command-line
20+ // There is no local npm
21+ grunt . util . spawn ( {
22+ cmd : "npm" ,
23+ args : [ "install" , "jsdom@" + version ] ,
24+ opts : { stdio : "inherit" }
25+ } , this . async ( ) ) ;
26+ } ) ;
27+ } ;
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ module.exports = function( grunt ) {
55 var fs = require ( "fs" ) ,
66 spawnTest = require ( "./lib/spawn_test.js" ) ,
77 testsDir = "./test/node_smoke_tests/" ,
8- nodeSmokeTests = [ ] ;
8+ nodeSmokeTests = [ "jsdom" ] ;
99
1010 // Fire up all tests defined in test/node_smoke_tests/*.js in spawned sub-processes.
1111 // All the files under test/node_smoke_tests/*.js are supposed to exit with 0 code
Original file line number Diff line number Diff line change 4242 "grunt-jsonlint" : " 1.0.4" ,
4343 "grunt-npmcopy" : " 0.1.0" ,
4444 "gzip-js" : " 0.3.2" ,
45- "jsdom" : " 3.1.2" ,
4645 "load-grunt-tasks" : " 1.0.0" ,
4746 "native-promise-only" : " 0.7.8-a" ,
4847 "promises-aplus-tests" : " 2.1.0" ,
5453 "testswarm" : " 1.1.0" ,
5554 "win-spawn" : " 2.0.0"
5655 },
56+ "jsdomVersions" : {
57+ "node" : " 3.1.2" ,
58+ "iojs" : " 5.3.0"
59+ },
5760 "scripts" : {
5861 "build" : " npm install && grunt" ,
5962 "start" : " grunt watch" ,
You can’t perform that action at this time.
0 commit comments