Skip to content

Question: how to mock orm:MikroOrm in a class that uses UseRequestContext decorator #49

Answered by B4nan
jearangoo asked this question in Q&A
Discussion options

You must be logged in to vote

but typescript complains that the connect option is not a valid property

Because it is not - it never was a config option, it is a second parameter to MikroORM.init().

if i pass a empty object to the MikroORM.init method

If you pass empty object to the init method, you obviously get validation errors for the required things you havent provided.

useValue: await MikroORM.init<MongoDriver>({type:'mongo',entities:[User,UserRole],dbName:'test'}, false)

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by jearangoo
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
bug Something isn't working
2 participants
Converted from issue

This discussion was converted from issue #48 on December 20, 2021 18:26.