Skip to content

Instantly share code, notes, and snippets.

@barsumek
Last active November 22, 2018 13:43
Show Gist options
  • Save barsumek/50cf9523c3ebfca01d3450f1daf39a1b to your computer and use it in GitHub Desktop.
Save barsumek/50cf9523c3ebfca01d3450f1daf39a1b to your computer and use it in GitHub Desktop.
Detox your GraphQL: Mock the Pokemon's level
// Test non-max Pokemon level
{
const defaultPokemon = {
Pokemon: () => ({
level: 10
})
};
//...
await startGraphQLServer({ ...defaultPokemon });
}
// Test max Pokemon level
{
const maxLvlPokemon = {
Pokemon: () => ({
level: 30
})
};
//...
await startGraphQLServer({ ...maxLvlPokemon });
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment