Last active
November 26, 2018 17:27
-
-
Save stubailo/9473f71aeea5040c3e5be98675b92c5e to your computer and use it in GitHub Desktop.
A Jest test with ApolloMockingProvider
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it('renders a list', async () => { | |
const customResolvers = { | |
Todo: () => ({ | |
text: 'My todo item', | |
}), | |
}; | |
const wrapper = mount( | |
<ApolloMockingProvider customResolvers={customResolvers}> | |
<TodoList /> | |
</ApolloMockingProvider>, | |
); | |
await wait(0); // Use a waiting library of your choice | |
const text = wrapper.text(); | |
expect(text).toMatch(/My todo item/); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment