angular-cn/packages/zone.js/test/common
JiaLiPassion 8456c5ec60 feat(zone.js): add a zone config to allow user disable wrapping uncaught promise rejection (#35873)
Close #27840.

By default, `zone.js` wrap uncaught promise error and wrap it to a new Error object with some
additional information includes the value of the error and the stack trace.

Consider the following example:

```
Zone.current
  .fork({
    name: 'promise-error',
    onHandleError: (delegate: ZoneDelegate, current: Zone, target: Zone, error: any): boolean => {
      console.log('caught an error', error);
      delegate.handleError(target, error);
      return false;
    }
}).run(() => {
  const originalError = new Error('testError');
  Promise.reject(originalError);
});
```

The `promise-error` zone catches a wrapped `Error` object whose `rejection` property equals
to the original error, and the message will be `Uncaught (in promise): testError....`,
You can disable this wrapping behavior by defining a global configuraiton
`__zone_symbol__DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION = true;` before importing `zone.js`.

PR Close #35873
2020-03-16 09:00:10 -07:00
..
Error.spec.ts build: move zone.js to angular repo (#30962) 2019-06-20 11:27:39 -07:00
Promise.spec.ts fix: should also allow subclass Promise without Symbol.species (#34533) 2020-01-31 13:17:59 -08:00
fetch.spec.ts build: typescript 3.7 support (#33717) 2020-01-14 16:42:21 -08:00
microtasks.spec.ts build: move zone.js to angular repo (#30962) 2019-06-20 11:27:39 -07:00
promise-disable-wrap-uncaught-promise-rejection.spec.ts feat(zone.js): add a zone config to allow user disable wrapping uncaught promise rejection (#35873) 2020-03-16 09:00:10 -07:00
setInterval.spec.ts build: move zone.js to angular repo (#30962) 2019-06-20 11:27:39 -07:00
setTimeout.spec.ts build: move zone.js to angular repo (#30962) 2019-06-20 11:27:39 -07:00
task.spec.ts refactor: ensure zone.js can be built with typescript strict flag (#30993) 2019-07-18 14:21:26 -07:00
toString.spec.ts build: move zone.js to angular repo (#30962) 2019-06-20 11:27:39 -07:00
util.spec.ts build: move zone.js to angular repo (#30962) 2019-06-20 11:27:39 -07:00
zone.spec.ts fix(zone.js): hook should set correct current zone (#31642) 2019-07-24 14:34:58 -07:00