Based on the discussion for handling concurrency and atomic tests (https://github.com/avajs/ava/issues/472)
I would like the best approach to test my server endpoints in parallel.
I'm using a koajs server and a mongodb database (mongoose)
I'm trying to use Mockgoose (https://github.com/mccormicka/Mockgoose) to create a temporary in-memory mongod that will not persist the data
I wanna know if creating a separate database for each test is a good approach?
Is there any example of this?
Not for AVA, but for Jest, you can use Jest testEnvironment setting to create a new environment which builds a mongodb database for each test, using the library mongodb-memory-server.
I've written about this with more details here: https://itnext.io/parallel-testing-a-graphql-server-with-jest-44e206f3e7d2