Skip to content

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

Open
oscarsotoo1 wants to merge 5 commits intomoleculerjs:masterfrom
oscarsotoo1:feat/testing-helpers
Open

feat(testing): add testing-helpers package for unit tests#1338
oscarsotoo1 wants to merge 5 commits intomoleculerjs: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! 🙏

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