GoodDAPP
GoodDAPP copied to clipboard
Use collection mock in the profile / feed unit tests
Testing with the real database (despite it’s dev instance) isn't a good option.
Generally any backend should be mocked during tests as a) we want to test especially our code b) we won't be dependent from its uptime
I suggest to look onto https://github.com/williamkapke/mongo-mock
- [ ] check is it possible to disable persist to js file and mock in memory only
- [ ] find a way to easily mock collections for tests. Maybe to pass a mongo instance to the realm db constructor. on the app the real db should be passed, for the tests - an mongo mock instance.