aboutsummaryrefslogtreecommitdiffstats
path: root/test/promises_aplus_adapters/deferred.js
blob: 5e3ffe2d854839545b0a9b53f1e661b408433d5a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
"use strict";

const { JSDOM } = require( "jsdom" );

const { window } = new JSDOM( "" );

const jQuery = require( "../../" )( window );

module.exports.deferred = () => {
	const deferred = jQuery.Deferred();

	return {
		promise: deferred.promise(),
		resolve: deferred.resolve.bind( deferred ),
		reject: deferred.reject.bind( deferred )
	};
};