Don't load Bluebird for createPromiseCallback

The decision which Promise implementation to use should be made by
LoopBack user, not by the framework.

This commit moves Bluebird reference from lib/utils.js to
test/support.js.
This commit is contained in:
Miroslav Bajtoš 2015-08-04 11:00:18 +02:00
parent aa5c9e3628
commit 98784e2b4b
2 changed files with 5 additions and 2 deletions

View File

@ -1,6 +1,5 @@
exports.createPromiseCallback = createPromiseCallback;
var Promise = global.Promise = require('bluebird');
function createPromiseCallback() {
var cb;
@ -12,7 +11,7 @@ function createPromiseCallback() {
return cb;
}
var promise = new Promise(function(resolve, reject) {
var promise = new global.Promise(function(resolve, reject) {
cb = function(err, data) {
if (err) return reject(err);
return resolve(data);

View File

@ -47,3 +47,7 @@ assert.isFunc = function(obj, name) {
assert(obj, 'cannot assert function ' + name + ' on object that doesnt exist');
assert(typeof obj[name] === 'function', name + ' is not a function');
};
if (!('Promise' in global)) {
global.Promise = require('bluebird');
}