<!-- Love Jest? Please consider supporting our collective: 👉 https://opencollective.com/jest/donate --> ## 🐛 Bug Report or Feature Request Unable to match on the object of the error of the rejected promise. ## To Reproduce ``` await expect(axios(badUrl)).rejects.toThrow() ``` ## Expected behavior Being able to access the error object and match on its objects. ``` await expect(axios(badUrl)).rejects.toThrow( (error) => error.reponse.status === 404) ``` Essentially I want to do this but without ES Lint yelling at me: ``` try { await axios(url); } catch (error) { expect(error.response.status).toBe(404); } ```