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

The done fn created by jasmine-patch.js does not support done.fail #180

@vicb

Description

@vicb

Original issue angular/angular#4136

The done.fail option in Jasmine 2.0 makes it easy to report the error from a failed promise but done.fail isn't implemented by the zone-aware version from jasmine-patch.js.

Therefore, the following test reports an async timeout instead of the actual error:

  // this test fails the wrong way
  it('async test with rejected promise reports error as expected via "done.fail"', done => {
    Promise.reject('failed on purpose')
      .then(result => {
        fail('should not get here');
      })
      .then(done,
        reason => {
          done.fail(reason); // written this way for easy breakpointing
        });
  });

Not a huge priority but worth fixing and easy to fix.

/cc @wardbell

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions