fix(zone.js): don't wrap uncaught promise error. (#31443)

Close #27840

PR Close #31443
This commit is contained in:
JiaLiPassion
2019-07-07 11:07:32 +08:00
committed by Miško Hevery
parent 6b51ed29ef
commit 2bb9a65351
3 changed files with 54 additions and 21 deletions

View File

@ -84,9 +84,7 @@ describe('FakeAsyncTestZoneSpec', () => {
() => {
fakeAsyncTestZone.run(() => {
Promise.resolve(null).then((_) => { throw new Error('async'); });
expect(() => {
testZoneSpec.flushMicrotasks();
}).toThrowError(/Uncaught \(in promise\): Error: async/);
expect(() => { testZoneSpec.flushMicrotasks(); }).toThrowError(/async/);
});
});
@ -1171,7 +1169,7 @@ const {fakeAsync, tick, discardPeriodicTasks, flush, flushMicrotasks} = fakeAsyn
resolvedPromise.then((_) => { throw new Error('async'); });
flushMicrotasks();
})();
}).toThrowError(/Uncaught \(in promise\): Error: async/);
}).toThrowError(/async/);
});
it('should complain if a test throws an exception', () => {