Skip to content

feat(testing): add testing-helpers package for unit tests#1338

Closed
oscarsotoo1 wants to merge 5 commits into
moleculerjs:masterfrom
oscarsotoo1:feat/testing-helpers
Closed

feat(testing): add testing-helpers package for unit tests#1338
oscarsotoo1 wants to merge 5 commits into
moleculerjs:masterfrom
oscarsotoo1:feat/testing-helpers

Conversation

@oscarsotoo1
Copy link
Copy Markdown

@oscarsotoo1 oscarsotoo1 commented Oct 8, 2025

What

Add @moleculer/testing-helpers package with createBrokerHelper, mockAction and mockEvent utilities to make unit testing brokers easier.

Why

  • Simplifies mocking actions/events in unit tests.
  • Keeps tests isolated and readable.

Verification

  • All tests pass locally: npm test

Notes

  • This is a self-contained package under packages/testing-helpers.
  • Please run CI and let me know if any formatting/lint issues show up.

Related: moleculerjs/rfcs#3
Bounty: https://oss.issuehunt.io/r/moleculerjs/rfcs/issues/3

I claim this bounty and will maintain this PR until merged. / Reclamo este bounty y mantendré este PR hasta que sea mergeado.

@oscarsotoo1
Copy link
Copy Markdown
Author

Hi maintainers 👋

I created this PR to add @moleculer/testing-helpers (packages/testing-helpers) which simplifies unit testing for brokers. All tests and lint pass locally (npm test, npx eslint).

I claim the IssueHunt bounty: https://oss.issuehunt.io/r/moleculerjs/rfcs/issues/3

Please review when you have a moment — I will address any feedback promptly. Thanks! 🙏

@icebob-ai
Copy link
Copy Markdown
Contributor

Closing this PR. There are multiple duplicate PRs implementing the same RFC #3, and we'll be handling the testing helpers implementation internally as part of the v0.15 release. Thank you for your interest in contributing to Moleculer.

@icebob-ai icebob-ai closed this May 15, 2026
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.

2 participants