Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ardatan committed Mar 14, 2019
1 parent ec07aed commit 501ce4e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docs/introduction/test-your-module.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,16 @@ tests/user.module.spec.ts
import { execute } from 'graphql';
describe('UserModule', async () => {
it('FieldResolver of Query: userById', async () => {
UserModule.injector.provide({
const { schema, context, injector } = UserModule;

injector.provide({
provide: UserProvider,
overwrite: true,
useValue: {
userById: (id: string) => { id, username: 'USERNAME' }
}
});

const result = await execute({
schema,
document: gql`
Expand Down

0 comments on commit 501ce4e

Please sign in to comment.