Replies: 1 comment 2 replies
-
Hi. Currently, there is no solution for this. The thing is on the init step it prepares a lot of things on the class level - without them most of the methods, or will not work, or will work incorrectly. If you want to use mocks, you probably can take a look at this lib: https://github.com/roman-right/beanita. Be aware - it doesn't cover some mongodb operations. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I wish to test using beanie as it represents the models in my system.
With beanie I've expected the same behavior like the JS lib mongoose
And then I can mock the repository layer and prevent the need to use actual DB
However, when attempting this in beanie I stumble upon
CollectionWasNotInitialized
Which seems weird since I didn't expect the Model to reach the DB unless I actually call
beanie.init
Could you suggest a possible solution? I don't want to fire up in-memory/docker instance of mongodb...
Beta Was this translation helpful? Give feedback.
All reactions