Skip to content

Mocking dependency injection to test resolver #888

Answered by MichalLytek
akexinad asked this question in Q&A

You must be logged in to vote

mock a dependency injection when using type-graphql?

This is a question for DI lib you're using. TypeGraphQL only calls Container.get, that's it. Nothing more on TypeGraphQL side.

Based on @Service() looks like you're using TypeDI. The whole purpose of DI container is to register mock inside it instead of mocking JS module by Jest.

Replies: 1 comment 1 reply

You must be logged in to vote
1 reply
@akexinad

Answer selected by akexinad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants