Skip to content

replace mocha and nyc with native node test runner and c8#54

Merged
wesleytodd merged 3 commits intojshttp:masterfrom
Phillip9587:node-test-runner
Mar 5, 2025
Merged

replace mocha and nyc with native node test runner and c8#54
wesleytodd merged 3 commits intojshttp:masterfrom
Phillip9587:node-test-runner

Conversation

@Phillip9587
Copy link
Contributor

@Phillip9587 Phillip9587 commented Oct 22, 2024

This PR refactors the test setup by replacing Mocha and NYC with Node.js's native test runner (node:test) and c8 for coverage reporting.

Key Changes:

  • Replaced Mocha and NYC with the native Node.js test runner and c8 for code coverage.
  • Updated test scripts to align with the new setup, improving maintainability and reducing reliance on external libraries.
  • Replaced deep-equal with native assert.deepEqual.
  • Updates the CI pipeline

Benefits:
These changes modernize the testing framework, reduce external dependencies, and uphold code coverage standards using built-in Node.js capabilities.

@socket-security
Copy link

socket-security bot commented Oct 22, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/c8@10.1.3 Transitive: environment, filesystem, shell, unsafe +63 4.93 MB

🚮 Removed packages: npm/deep-equal@1.0.1, npm/nyc@15.1.0

View full report↗︎

Copy link
Member

@wesleytodd wesleytodd left a comment

Choose a reason for hiding this comment

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

I am on the fence on adopting the node test runner yet, but I am a fan of trying in one package, so I am approving this. But I will tag in the @jshttp/express-tc in case anyone has strong opinions.

@wesleytodd wesleytodd mentioned this pull request Jan 23, 2025
@ctcpip ctcpip requested a review from blakeembrey January 23, 2025 17:50
@ctcpip
Copy link
Member

ctcpip commented Jan 23, 2025

relevant express team discussion on the topic of the node test runner, and test runners in general: https://openjs-foundation.slack.com/archives/C02QB1731FH/p1729689394701019

Copy link
Member

@bjohansebas bjohansebas left a comment

Choose a reason for hiding this comment

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

+1 on trying it in a single package for now, probably before releasing, the captain should agree, which in this case is @blakeembrey

Copy link
Member

@UlisesGascon UlisesGascon left a comment

Choose a reason for hiding this comment

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

LGTM! @Phillip9587 can you work on the conflct? 🙏

@Phillip9587
Copy link
Contributor Author

@UlisesGascon Done!

@Phillip9587
Copy link
Contributor Author

Hey @blakeembrey, could you take a look at this and confirm if you're on board with the changes? Let me know if you have any concerns!

@wesleytodd
Copy link
Member

I am going to push this one forward, it is not a blocking review and Blake has much more important things going on in life so I don't want to force attention on this which is rather low risk.

@wesleytodd wesleytodd merged commit 88a9eea into jshttp:master Mar 5, 2025
10 checks passed
@Phillip9587 Phillip9587 deleted the node-test-runner branch March 31, 2025 20:18
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.

5 participants