Skip to content

Commit

Permalink
Add React Apollo changes from PR #3539
Browse files Browse the repository at this point in the history
  • Loading branch information
hwillson committed Oct 2, 2019
1 parent 7e87e38 commit 4b7593c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/react/testing/mocks/mockLink.ts
Expand Up @@ -87,13 +87,15 @@ export class MockLink extends ApolloLink {

this.mockedResponsesByKey[key].splice(responseIndex, 1);

const { result, error, delay, newData } = response;
const { newData } = response;

if (newData) {
response.result = newData();
this.mockedResponsesByKey[key].push(response);
}

const { result, error, delay } = response;

if (!result && !error) {
throw new Error(
`Mocked response should contain either result or error: ${key}`
Expand Down

0 comments on commit 4b7593c

Please sign in to comment.