Add MongoDB Atlas Local support#1396
Conversation
✅ Deploy Preview for testcontainers-node ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Nice work — mirrors testcontainers-java's MongoDBAtlasLocalContainer and correctly relies on the managed image. Main asks: credentialed connection strings are missing authSource=admin (and no test actually authenticates), and the test image should be pinned in the Dockerfile. Rest is inline.
Keeping this as its own container instead of a flag on MongoDBContainer is the right call — different image, different internals, and matches java/go.
Rename `## Examples` to `## MongoDBContainer` and `## MongoDB Atlas Local` to `## MongoDBAtlasLocalContainer` so both containers are peer H2 sections whose headings match their exported class names.
The root user is created in the admin database, so connection strings that carry credentials must authenticate against it. Add an authenticated test that inserts a document to cover the behavior.
Add the Atlas Local image as a second FROM line and read it via getImage(__dirname, 1) instead of hardcoding the tag, so Renovate keeps it up to date.
The Atlas Local image uses MONGODB_INITDB_* rather than the MONGO_INITDB_* used by mongodb-container.ts; add a comment so it is not "fixed" to match the sibling file.
Keep the marker inside the it() body like the other snippets in the file, so the generated doc example excludes the test wrapper and try/finally.
cristianrgreco
left a comment
There was a problem hiding this comment.
All feedback addressed — authSource=admin is now set for credentialed connection strings and covered by a test that actually authenticates against the /test database, the Atlas image is pinned in the Dockerfile, and the docs/codeinclude structure is consistent. Nice work. LGTM.
MongoDBAtlasLocalContainerto the MongoDB module