generated from hackforla/.github-hackforla-base-repo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 97
Open
Labels
Epic/OverviewContains a list of other issues or an overview of issueContains a list of other issues or an overview of issuecomplexity: mediumfeature: InfrastructureSecrets, Prod and Dev setup, etc.Secrets, Prod and Dev setup, etc.role: Back Endsize: EpicSize not relevant (epic issue)Size not relevant (epic issue)
Milestone
Description
Overview
MongoDB backend tests are failing intermittently due to the state of the database not being properly reset between tests. We need narrative-style integration tests for each router, where the end state of each test can be used as the start state of the next test.
Additional Information:
Our current backend tests that access MongoDB are intermittently failing because the state of the database is not resetting properly between tests. We need to write new integration tests that flow like a narrative for each express route, i.e. for `user.router.js` we need a set of tests that first create a user, then read, update, and delete; where each test depends on the end state of the previous test. This will ensure that our tests don't fail intermittently. We may however want to implement the tests such that as soon as one test in a flow fails, the rest are skipped, because presumably, the state won't have been set properly and the remaining tests would fail.Action Items
First we need to re-configure jest and our directory structure to accommodate the development of new tests:
- Move old tests from routers directory into a new directory and skip them #1898
- Reconfigure Jest for new backend integration tests and clear outdated configs #1900
Then we need to write new integration tests based on the routes of each router:
- Create integration test for User API Endpoints #1935
- Create integration test for Project API Endpoints #1948
- Create integration test for Auth API Endpoints #1949
Resources/Instructions
https://jestjs.io/docs/configuration
https://jestjs.io/docs/getting-started
https://softwareengineering.stackexchange.com/questions/221766/how-to-structure-tests-where-one-test-is-another-tests-setup
For an example, please view #1945
Metadata
Metadata
Assignees
Labels
Epic/OverviewContains a list of other issues or an overview of issueContains a list of other issues or an overview of issuecomplexity: mediumfeature: InfrastructureSecrets, Prod and Dev setup, etc.Secrets, Prod and Dev setup, etc.role: Back Endsize: EpicSize not relevant (epic issue)Size not relevant (epic issue)
Type
Projects
Status
Epic Issues