Promise
.toResolve()
Use .toResolve
when checking if a promise is resolved.
test('passes when a promise resolves', async () => { await expect(Promise.resolve()).toResolve(); });
Tests
.toReject()
Use .toReject
when checking if a promise is rejected.
test('passes when a promise rejects', async () => { await expect(Promise.reject()).toReject(); });
Tests