RealDevSquad / RealDevSquad/website-backend
Create a test suite
Open
@Cartmanishere is already working on this.
Since Jan 21, 2021.
enhancement
- Dominant language
- JavaScript
- Stars
- 74
- Forks
- 276
- Avg merge
- 1d 26m
- Merged PRs (30d)
- 14
Description
Create a test suite using the mocha APIs for the project to facilitate the following:
- Add firestore config for test or use any firestore mocking libraries(if available), and thus remove all model function mocks ✅
- Define custom test specific config.
- Be able to define custom config for tests to achieve https://github.com/Real-Dev-Squad/website-backend/blob/develop/middlewares/authenticate.js#L14
- Reduce redundancy in each test files ✅
- Use Mocha API https://mochajs.org/api/mocha to start the test suite and define globals
- Start the server only once rather than passing the server.js to chai HTTP module
- Mocking XHR calls ✅
- Mocking function calls ✅
- Test coverage in the repo ✅
====================================================================================
Current issues in test suite:
firebase emulators:start(code) is a blocking process and does not get terminates after the test process gets finished. ✅- Create an interface/utility to flush the DB. It can be used in the mocha tests as per required.
- Define custom test specific config.
- Be able to define custom config for tests to achieve https://github.com/Real-Dev-Squad/website-backend/blob/develop/middlewares/authenticate.js#L14
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.