File tree Expand file tree Collapse file tree 4 files changed +37
-1
lines changed Expand file tree Collapse file tree 4 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ module.exports = function( grunt ) {
10
10
}
11
11
12
12
var gzip = require ( "gzip-js" ) ,
13
+ spawn = require ( "child_process" ) . spawn ,
13
14
srcHintOptions = readOptionalJSON ( "src/.jshintrc" ) ;
14
15
15
16
// The concatenated file won't pass onevar
@@ -160,6 +161,18 @@ module.exports = function( grunt ) {
160
161
161
162
grunt . registerTask ( "lint" , [ "jshint" , "jscs" ] ) ;
162
163
164
+ grunt . registerTask ( "promises-aplus-tests" , function ( ) {
165
+ var done = this . async ( ) ;
166
+ spawn ( "node" , [
167
+ "./node_modules/.bin/promises-aplus-tests" ,
168
+ "./promises-aplus-adapter.js"
169
+ ] , {
170
+ stdio : "inherit"
171
+ } ) . on ( "close" , function ( code ) {
172
+ done ( code === 0 ) ;
173
+ } ) ;
174
+ } ) ;
175
+
163
176
// Short list as a high frequency watch task
164
177
grunt . registerTask ( "dev" , [ "build:*:*" , "lint" ] ) ;
165
178
Original file line number Diff line number Diff line change 43
43
"grunt-jsonlint" : " 1.0.4" ,
44
44
"grunt-npmcopy" : " 0.1.0" ,
45
45
"gzip-js" : " 0.3.2" ,
46
+ "jsdom" : " 1.0.0-pre.6" ,
46
47
"load-grunt-tasks" : " 0.6.0" ,
47
48
"npm" : " 1.4.21" ,
49
+ "promises-aplus-tests" : " 2.0.5" ,
48
50
"q" : " 1.0.1" ,
49
51
"qunitjs" : " 1.14.0" ,
50
52
"requirejs" : " 2.1.14" ,
Original file line number Diff line number Diff line change
1
+ "use strict" ;
2
+
3
+ require ( "jsdom" ) . env ( "" , function ( errors , window ) {
4
+ if ( errors ) {
5
+ console . error ( errors ) ;
6
+ return ;
7
+ }
8
+ var jQuery = require ( "./" ) ( window ) ;
9
+
10
+ exports . deferred = function ( ) {
11
+ var deferred = jQuery . Deferred ( ) ;
12
+
13
+ return {
14
+ get promise ( ) {
15
+ return deferred . promise ( ) ;
16
+ } ,
17
+ resolve : deferred . resolve . bind ( deferred ) ,
18
+ reject : deferred . reject . bind ( deferred )
19
+ } ;
20
+ } ;
21
+ } ) ;
Original file line number Diff line number Diff line change 41
41
allTypes = "*/" . concat ( "*" ) ,
42
42
43
43
// Document location
44
- ajaxLocation = location . href ,
44
+ ajaxLocation = window . location . href ,
45
45
46
46
// Segment location into parts
47
47
ajaxLocParts = rurl . exec ( ajaxLocation . toLowerCase ( ) ) || [ ] ;
You can’t perform that action at this time.
0 commit comments