Skip to content

Conversation

@SethFalco
Copy link
Member

@SethFalco SethFalco commented Nov 2, 2025

Description

Node.js has added a standard library for Node.js unit testing, which has become more mature over the years, including a test runner, mocking support, coverage, etc.

See: https://nodejs.org/en/learn/test-runner/using-test-runner

I propose we migrate from mocha/sinon/should/nyc to just the standard library, which provides everything we need without adding literally 170 npm dependencies to the project.

  • Drops 4 dev dependencies.
  • Drops 170 indirect dependencies. (i.e. node_modules not declared in package.json)
  • Easier to maintain and find maintainers for as it's safe to assume exposure to node:test, whereas testing in the Node.js ecosystem has traditionally been very fragmented.

All tests have been kept intact, this just migrates from one library to the standard library. I've been using node:test in all of my other projects as well, and it's pretty great imo.

Checklist

Please review this checklist before submitting a pull request.

  • Code compiles correctly
  • Created tests, if possible
  • All tests passing (npm run test:all)
  • Extended the README / documentation, if necessary

Copy link
Member

@owenvoke owenvoke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm personally in favour of this partly just due to the pretty big reduction in dependencies. 👀 I didn't know that Node had it's own test runner for a while, that's pretty neat. 👍🏻

However, I guess if people are used to working with the current setup and it's not broken, perhaps we should stick to it. 🤷🏻 But will leave to other maintainers with more familiarity with the project to approve. 👍🏻

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