I have a promise-based Jest test with a structure like this:
.then(() => {
<some expect()s> // (A)
return ...;
})
.then((data) => {
<some expect()s> // (B)
return ...;
})
.then((data) => {
<some expect()s> // (C)
done(); // Tell Jest the test is done.
});
The problem: If one of the expect() checks fails in (A) or (B) or (C) then Jest waits until the test timeout before reporting the results.
How do I make Jest finish immediately and display the results as soon as an expect() fails?