Skip to content

7 hello007/fix/remove hardcoded mongodb uri - #438

Closed
7-hello007 wants to merge 11 commits into
mainfrom
7-hello007/fix/remove-hardcoded-mongodb-uri
Closed

7 hello007/fix/remove hardcoded mongodb uri#438
7-hello007 wants to merge 11 commits into
mainfrom
7-hello007/fix/remove-hardcoded-mongodb-uri

Conversation

@7-hello007

@7-hello007 7-hello007 commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

test: enforce MONGO_TEST_URI for test database isolation

  • Add testHelper.js with connectTestDB() and disconnectTestDB()
  • Add testHelper.test.js for unit testing the helper
  • Update all test files to use connectTestDB() instead of direct mongoose.connect
  • Require MONGO_TEST_URI to be set; refuse to run tests without it
  • Update .env.example with MONGO_TEST_URI example

This prevents accidental data corruption in development or shared databases when running tests.

image

- Remove hardcoded Atlas URI fallback from connectDB.js
- Add validation that requires MONGO_URI to be set
- Show clear error message when MONGO_URI is missing
- Update .env.example to mark MONGO_URI as required
- Update README environment variable documentation"
- Add testHelper.js with connectTestDB() and disconnectTestDB()
- Add testHelper.test.js for unit testing the helper
- Update all test files to use connectTestDB() instead of direct mongoose.connect
- Require MONGO_TEST_URI to be set; refuse to run tests without it
- Update .env.example with MONGO_TEST_URI example

This prevents accidental data corruption in development or shared databases when running tests.
Added a new table header for method descriptions in the API documentation.
Added new SOS endpoints for emergency management.
@7-hello007

Copy link
Copy Markdown
Collaborator Author

This PR originates from the wrong branch. The planned changes are being moved to PR #429.

@7-hello007 7-hello007 closed this Jul 28, 2026
@7-hello007
7-hello007 deleted the 7-hello007/fix/remove-hardcoded-mongodb-uri branch July 28, 2026 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant