diff options
Diffstat (limited to 'test/promises_aplus_adapter_deferred.js')
-rw-r--r-- | test/promises_aplus_adapter_deferred.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/promises_aplus_adapter_deferred.js b/test/promises_aplus_adapter_deferred.js new file mode 100644 index 000000000..c7440b969 --- /dev/null +++ b/test/promises_aplus_adapter_deferred.js @@ -0,0 +1,22 @@ +/* jshint node: true */ + +"use strict"; + +require( "jsdom" ).env( "", function( errors, window ) { + if ( errors ) { + console.error( errors ); + return; + } + + var jQuery = require( ".." )( window ); + + exports.deferred = function() { + var deferred = jQuery.Deferred(); + + return { + promise: deferred.promise(), + resolve: deferred.resolve.bind( deferred ), + reject: deferred.reject.bind( deferred ) + }; + }; +} ); |