new PromiseSubject(failureStrategy, value)
Subject subclass which provides assertion methods for promise types.
Parameters:
Name | Type | Description |
---|---|---|
failureStrategy |
FailureStrategy | The failure strategy to use when an assertion fails. |
value |
* | The value being checked. |
- Source:
Extends
- Subject
Methods
eventually() → {DeferredSubject}
Ensure that the promise succeds, and returns a 'deferred subject' - an object that allows assertions methods to be called, but doesn't actually execute the assertions until after the promise has resolved.
- Source:
Returns:
The deferred subject.
- Type
- DeferredSubject
fails() → {PromiseSubject}
Ensure that the promise eventually fails.
- Source:
Returns:
this
for chaining.
- Type
- PromiseSubject
failsWith(expected) → {PromiseSubject}
Ensure that the promise eventually fails with the specified reason.
Parameters:
Name | Type | Description |
---|---|---|
expected |
* | The expected reason for rejection. |
- Source:
Returns:
this
for chaining.
- Type
- PromiseSubject
succeeds() → {PromiseSubject}
Ensure that the promise eventually succeeds.
- Source:
Returns:
this
for chaining.
- Type
- PromiseSubject
succeedsWith(expected) → {PromiseSubject}
Ensure that the promise eventually succeeds with the specified value.
Parameters:
Name | Type | Description |
---|---|---|
expected |
* | The value that the promise must resolve to. |
- Source:
Returns:
this
for chaining.
- Type
- PromiseSubject