jellyfin-web/dashboard-ui/bower_components/native-promise-only/test_adapter.js

22 lines
518 B
JavaScript
Raw Normal View History

2015-12-14 08:43:03 -07:00
// Adapter for "promises-aplus-tests" test runner
var path = require("path");
var Promise = require(path.join(__dirname,"lib","npo.src.js"));
module.exports.deferred = function __deferred__() {
var o = {};
o.promise = new Promise(function __Promise__(resolve,reject){
o.resolve = resolve;
o.reject = reject;
});
return o;
};
module.exports.resolved = function __resolved__(val) {
return Promise.resolve(val);
};
module.exports.rejected = function __rejected__(reason) {
return Promise.reject(reason);
};