diff --git a/src/Mutate.test.tsx b/src/Mutate.test.tsx index 15be474f..0e0d2482 100644 --- a/src/Mutate.test.tsx +++ b/src/Mutate.test.tsx @@ -294,6 +294,11 @@ describe("Mutate", () => { message: "Failed to fetch: 500 Internal Server Error", status: 500, }); + expect(children.mock.calls[2][1].error).toEqual({ + data: { error: "oh no… not again…" }, + message: "Failed to fetch: 500 Internal Server Error", + status: 500, + }); }); }); diff --git a/src/Mutate.tsx b/src/Mutate.tsx index 826c78c3..a2fa5e5b 100644 --- a/src/Mutate.tsx +++ b/src/Mutate.tsx @@ -178,6 +178,7 @@ class ContextlessMutate extends React }; this.setState({ + error, loading: false, });