Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
Pass actual error to failCallback (#383)
Browse files Browse the repository at this point in the history
* Pass actual error to failCallback

* Fix tests to accept Error object and check message property
  • Loading branch information
schmuli authored and mhevery committed Aug 11, 2016
1 parent 80ae6a8 commit dbcfb32
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/zone-spec/async-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
// Let the parent try to handle the error.
const result = parentZoneDelegate.handleError(targetZone, error);
if (result) {
this._failCallback(error.message ? error.message : 'unknown error');
this._failCallback(error);
this._alreadyErrored = true;
}
return false;
Expand Down
6 changes: 3 additions & 3 deletions test/zone-spec/async-test.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ describe('AsyncTestZoneSpec', function() {
var testZoneSpec = new AsyncTestZoneSpec(() => {
done.fail('expected failCallback to be called');
}, (err) => {
expect(err).toEqual('bad url failure');
expect(err.message).toEqual('bad url failure');
done();
}, 'name');

Expand Down Expand Up @@ -251,7 +251,7 @@ describe('AsyncTestZoneSpec', function() {
var testZoneSpec = new AsyncTestZoneSpec(() => {
done.fail('expected failCallback to be called');
}, (err) => {
expect(err).toEqual('my error');
expect(err.message).toEqual('my error');
done();
}, 'name');

Expand All @@ -270,7 +270,7 @@ describe('AsyncTestZoneSpec', function() {
var testZoneSpec = new AsyncTestZoneSpec(() => {
done.fail('expected failCallback to be called');
}, (err) => {
expect(err).toEqual('Uncaught (in promise): my reason');
expect(err.message).toEqual('Uncaught (in promise): my reason');
done();
}, 'name');

Expand Down

0 comments on commit dbcfb32

Please sign in to comment.