A function, that will be passed directly to expect()
Variation of subject that does not perform await
on its Promise
subject.
This is especially useful in the case of matchers - like toResolve()
-
whose subject is not the value returned by the Promise
, but the Promise
itself.
A Promise
or a function returning a Promise
Defines the subject of each test - i.e., the argument of the expect()
call.
Can be:
a value of any type - when not a Promise
or a function - that will be passed to expect()
a Promise
- that will be await
ed to get the expect()
argument
a function - that will be called to retrieve one of the above types and then behave accordingly
Variation of subject that does not call the passed function.
This is especially useful in the case of matchers expecting a function - like
.toThrow()
.