Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(wip): add a node-test plugin #688

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

rowanmanning
Copy link
Member

@rowanmanning rowanmanning commented Sep 13, 2024

Note

This is a draft because I'm looking for early feedback on my approach before writing tests.

Description

This adds a node-test plugin using node:test#run(). There are quite a few gotchas with this one:

  • If we want to support Node.js 18 and 20 then we can't use glob patterns (the globPatterns option) because it's only supported in Node.js 22. I think glob patterns are important so I've replicated with the glob package.

  • We don't support Node.js 18 less than v18.17.0, this is because there wasn't a consistent JavaScript API for the built-in test reporters before this version. This is captured in the engines. An alternative would be to drop Node.js 18 support in this package as we'll be doing this in April 2025 anyway.

  • There is no way of configuring the built-in test runner via a config file or similar. This means we need to expose more options than Jest or Mocha in the Tool Kit config file.

Checklist:

  • My branch has been rebased onto the latest commit on main (don't merge main into your branch)
  • My commit messages are conventional commits, for example: feat(circleci): add support for nightly workflows, fix: set Heroku app name for staging apps too

This adds a node-test plugin using `node:test#run()`. There are quite a
few gotchas with this one:

  * If we want to support Node.js 18 and 20 then we can't use glob
    patterns (the `globPatterns` option) because it's only supported in
    Node.js 22. I think glob patterns are important so I've replicated
    with the glob package.

  * We don't support Node.js 18 less than v18.17.0, this is because
    there wasn't a consistent JavaScript API for the built-in test
    reporters before this version. This is captured in the engines. An
    alternative would be to drop Node.js 18 support in this package as
    we'll be doing this in April 2025 anyway.

  * There is no way of configuring the built-in test runner via a config
    file or similar. This means we need to expose more options than Jest
    or Mocha in the Tool Kit config file.
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