matters-server
matters-server copied to clipboard
Better data isolation on unit testing
Description
Unit testing on server-side need to employ a mock API client ([testClient](https://github.com/thematters/matters-server/blob/develop/src/types/__test__/utils.ts#L120)) in each test. However, there is "data-coupling" since we use several hardcoded users and a shared test database, which violates the "I" of the F.I.R.S.T principle.
Checklist
- [ ] Revise
testClientto support generate a random new user; - [ ] Explore other ways of data isolation;