fix non-angular promise test

This commit is contained in:
AJ ONeal 2017-01-20 17:56:30 +00:00
parent 4c5d57fd8c
commit 7e864920b8
1 changed files with 9 additions and 6 deletions

View File

@ -22,20 +22,23 @@
// tests that this promise has all of the necessary api // tests that this promise has all of the necessary api
promise = new PromiseA(function (resolve, reject) { promise = new PromiseA(function (resolve, reject) {
if (x === 1) { //console.log('x [2]', x);
throw new Error("bad promise, create not asynchronous"); if (x !== 1) {
throw new Error("bad promise, create not Synchronous [0]");
} }
PromiseA.resolve().then(function () { PromiseA.resolve().then(function () {
var promise2; var promise2;
if (x === 1 || x === 2) { //console.log('x resolve', x);
throw new Error("bad promise, resolve not asynchronous"); if (x !== 2) {
throw new Error("bad promise, resolve not Asynchronous [1]");
} }
promise2 = PromiseA.reject().then(reject, function () { promise2 = PromiseA.reject().then(reject, function () {
if (x === 1 || x === 2 || x === 3) { //console.log('x reject', x);
throw new Error("bad promise, reject not asynchronous"); if (x !== 4) {
throw new Error("bad promise, reject not Asynchronous [2]");
} }
if ('undefined' === typeof angular) { if ('undefined' === typeof angular) {