property
test.MatchersBuiltin.rejects
rejects: AsyncMatchers<unknown>
Expects the value to be a promise that rejects, or a function that returns one.
await expect(Promise.reject("error")).rejects.toBe("error");