GoodDAPP icon indicating copy to clipboard operation
GoodDAPP copied to clipboard

Use collection mock in the profile / feed unit tests

Open serdiukov-o-nordwhale opened this issue 3 years ago • 0 comments

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.

serdiukov-o-nordwhale avatar Aug 13 '21 11:08 serdiukov-o-nordwhale