Skip to content

Add community-plugin-e2e-mdb package#57

Merged
SamTolmay merged 8 commits intomainfrom
feat/e2e-mdb-plugin
Mar 6, 2026
Merged

Add community-plugin-e2e-mdb package#57
SamTolmay merged 8 commits intomainfrom
feat/e2e-mdb-plugin

Conversation

@machielvdw
Copy link
Copy Markdown
Contributor

@machielvdw machielvdw commented Feb 5, 2026

Summary

Add @lowdefy/community-plugin-e2e-mdb package that provides Playwright fixtures for MongoDB e2e testing using mongodb-memory-server and YAML snap files.

Features

  • Worker-scoped MongoDB client - shared across tests in a worker
  • Test-scoped mdb helper - with automatic database cleanup per test
  • YAML snap files - load/save database state with !date tag support
  • Native MongoDB driver access - via mdb.collection(name) and mdb.db
  • Seed helper - clear and populate collections with mdb.seed()

Files added

  • plugins/community-plugin-e2e-mdb/package.json
  • plugins/community-plugin-e2e-mdb/src/index.js
  • plugins/community-plugin-e2e-mdb/src/fixtures/index.js
  • plugins/community-plugin-e2e-mdb/src/mdb/createMdbHelper.js
  • plugins/community-plugin-e2e-mdb/src/mdb/snap.js
  • plugins/community-plugin-e2e-mdb/src/mdb/seed.js
  • plugins/community-plugin-e2e-mdb/src/setup/globalSetup.js
  • plugins/community-plugin-e2e-mdb/src/setup/globalTeardown.js
  • plugins/community-plugin-e2e-mdb/src/utils/yaml.js
  • plugins/community-plugin-e2e-mdb/src/utils/paths.js
  • plugins/community-plugin-e2e-mdb/README.md

Test plan

  • pnpm install completed successfully
  • pnpm build compiled all 9 source files
  • All exports resolve correctly

Closes #56
Closes #58

@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
community-plugins Ready Ready Preview Feb 11, 2026 10:49am

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 5, 2026

🦋 Changeset detected

Latest commit: 59f9ba8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@lowdefy/community-plugin-e2e-mdb Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Add getDatabaseFromUri(uri) to derive the database name from the Mongo URI (falls back to 'test'). Use that DB for test fixtures instead of generating a per-test DB name. Change cleanup logic to clear all non-system collections (deleteMany) rather than dropping the database, preserving the shared DB while removing test data.
…tive driver

Simplify mdb fixture API to use native MongoDB driver directly instead of
custom wrapper methods. Removes polling-based expect(), clearCollection(),
and clearAllCollections(). Users now use mdb.collection() with native
MongoDB operations for assertions.

Closes #58

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@SamTolmay SamTolmay merged commit 0dc377f into main Mar 6, 2026
1 check passed
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.

Simplify e2e-mdb fixture to use native MongoDB driver Add MongoDB e2e testing plugin (@lowdefy/community-plugin-e2e-mdb)

2 participants