This example has been corrected from the original version by forcing the
event loop to turn using setTimeout
var Bluebird = Promise.noConflict(); // Restore previous reference to Promise
var nativePromise = Promise.resolve(); // Native Promise
var b = Bluebird.resolve(nativePromise); // Wrap native promise with Bluebird promise
// Force event loop to turn
setTimeout(function () {
console.log('Pending? ' + b.isPending()); // Pending? false
console.log('Fulfilled? ' + b.isFulfilled()); // Fulfilled? true
console.log('Rejected? ' + b.isRejected()); // Rejected? false
}, 0);