Asynchronous matchers.
Expect a promise to be rejected.
await expectAsync(aPromise).toBeRejected();
return expectAsync(aPromise).toBeRejected();
Expect a promise to be resolved.
await expectAsync(aPromise).toBeResolved();
return expectAsync(aPromise).toBeResolved();
Expect a promise to be resolved to a value equal to the expected, using deep equality comparison.
Name | Type | Description |
---|---|---|
expected | Object | Value that the promise is expected to resolve to |
await expectAsync(aPromise).toBeResolvedTo({prop: 'value'});
return expectAsync(aPromise).toBeResolvedTo({prop: 'value'});
© 2008–2017 Pivotal Labs
Licensed under the MIT License.
https://jasmine.github.io/api/3.2/async-matchers.html