2014-12-29 19:14:13 +00:00
|
|
|
"use strict";
|
|
|
|
|
2019-03-04 17:30:51 +00:00
|
|
|
const { JSDOM } = require( "jsdom" );
|
2014-12-29 19:14:13 +00:00
|
|
|
|
2019-03-04 17:30:51 +00:00
|
|
|
const { window } = new JSDOM( "" );
|
2014-12-29 19:14:13 +00:00
|
|
|
|
2019-03-04 17:30:51 +00:00
|
|
|
const jQuery = require( "../../" )( window );
|
2014-12-29 19:14:13 +00:00
|
|
|
|
2019-03-04 17:30:51 +00:00
|
|
|
module.exports.deferred = () => {
|
|
|
|
const deferred = jQuery.Deferred();
|
|
|
|
|
|
|
|
return {
|
|
|
|
promise: deferred.promise(),
|
|
|
|
resolve: deferred.resolve.bind( deferred ),
|
|
|
|
reject: deferred.reject.bind( deferred )
|
2014-12-29 19:14:13 +00:00
|
|
|
};
|
2019-03-04 17:30:51 +00:00
|
|
|
};
|