-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Description
Hi,
I have been facing a problem mocking data with MockedProvider.
With queries all works as expected, when I mock success and errors, the problem comes with mutations, success are ok but when I try to mock an error it is not passed to my component in the render function, instead an Error is thrown.
Test:
const mocks = [
{
request: {
query: MY_MUTATION,
variables: {
userId: 'error'
},
},
error: new Error('boom!')
}
];
it('my test that should pass', () => {
const wrapper = mount(
<MockedProvider mocks={mocks}>
<MyComponent ... />
</MockedProvider>
);
...Component:
<Mutation mutation={MY_MUTATION} >
{(cancelMandate, {loading, error}) => (
...When I run the test it just throw the exception but in a live environment it is passed to the component!
mintyfloss, amannn, veddermatic, skspade, svalchinov and 4 more
Metadata
Metadata
Assignees
Labels
No labels