docs: update Node.js requirements and add test documentation

- README.md: Update from Node 14/16 to Node 20+ (v22, v24 supported)
- README.md: Update MongoDB from 4.2/4.4 to 4.4+ (5.0, 6.0 supported)
- CONTRIBUTING.md: Add 'Running Tests Locally' section
- Document NODE_ENV=test requirement for safety
- Document npm scripts: test:unit, test:integration

Addresses DOC-NODE-001 and DOC-ENV-001 from release-15.0.7-documentation.md

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Ben West
2026-03-17 13:02:12 -07:00
co-authored by Copilot
parent cdef1e7c2c
commit 81393a4c1f
2 changed files with 26 additions and 2 deletions
+24
View File
@@ -142,6 +142,30 @@ Once `dev` has been reviewed and people feel it's time to release, we follow the
Every commit is tested by travis. We encourage adding tests to validate your design. We encourage discussing your use cases to help everyone get a better understanding of your design.
## Running Tests Locally
Tests **require** `NODE_ENV=test` to protect production databases from accidental destruction. If this variable is not set, tests will refuse to run and exit with an error.
```bash
# Run all tests
NODE_ENV=test npm test
# Run only unit tests (parallel, fast)
NODE_ENV=test npm run test:unit
# Run only integration tests (sequential, needs MongoDB)
NODE_ENV=test npm run test:integration
# Run specific test files
NODE_ENV=test npm test -- --grep "treatments"
```
You can create a `my.test.env` file based on `ci.test.env` for local testing:
```bash
source my.test.env && npm test
```
## Other Dev Tips
* Join the [Discord chat][discord-url].
+2 -2
View File
@@ -161,8 +161,8 @@ Older versions or other browsers might work, but are untested and unsupported. W
## Installation software requirements:
- [Node.js](http://nodejs.org/) Latest Node v14 or v16 LTS. Node versions that do not have the latest security patches will not be supported. Use [Install instructions for Node](https://nodejs.org/en/download/package-manager/) or use `bin/setup.sh`)
- [MongoDB](https://www.mongodb.com/download-center?jmp=nav#community) 4.2 or 4.4.
- [Node.js](http://nodejs.org/) Node v20 LTS or later (v22, v24 also supported). Node versions that do not have the latest security patches will not be supported. Use [Install instructions for Node](https://nodejs.org/en/download/package-manager/) or use `bin/setup.sh`)
- [MongoDB](https://www.mongodb.com/download-center?jmp=nav#community) 4.4 or later (5.0, 6.0 also supported).
As a non-root user clone this repo then install dependencies into the root of the project: