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

Update testing infrastructure; swap out test-runner for jest, fix coverage, and update Node support #133

Closed
zanerock opened this issue Jul 3, 2024 · 4 comments

Comments

@zanerock
Copy link

zanerock commented Jul 3, 2024

test-runner -> jest and fix coverage

The test-runner project does not seem to be under active development and command-line-rep is currently using an even older version (0.5) that the 2 year old version (0.10). Also, despite trying for an hour, I couldn't get the nyc coverage generation tool to work with test-runner.

  1. Update the tests. The swap to jest is pretty simple. Simply remove the import TestRunner from 'test-runner' and const runner = new TestRunner(). Then change runner.test to test and everything is ready to go.
  2. Update the packages. Remove the test-runner package and add the latest jest.
  3. Add jest.config.mjs.
  4. Update the scripts. Update test:js, test:mjs, and cover to use jest.

As a bonus, the true coverage is revealed at 94%!

Update Node support.

There's an outstanding PR that shows node 4 and 6 breaking with 8 unknown. The actual report isn't available, but these are really old versions and support can probably be dropped.

  1. Update the GitHub CI. I removed 4, 6, and 8, 10, and 12 and added 18, 20, and 22, and adjusted the 14 to ^14.15.x and 16 to ^16.10.x. 14.15 and 16.10 are the lowest versions supported by Jest v29.
  2. Updat the package.json engines specification to match the CI testing. From "node": ">=4.0 to "node": "^10 || ^12 || ^14.15.x || ^16.10.x || ^17 || ^18 || ^20 || ^22". There may be more to Node support strategy.
@75lb
Copy link
Owner

75lb commented Jul 3, 2024

Hi.. it's unlikely this project's test suite will migrate to Jest for several reasons but I agree it could do with a general refresh - will look into it.

@zanerock
Copy link
Author

zanerock commented Jul 4, 2024

I might be able to take a crack at it if you have a set of constraints. I would have spent more time getting the existing system working, but it just seemed like the test-runner project had run out of steam.

@75lb
Copy link
Owner

75lb commented Jul 4, 2024

I love the fact you're willing to put the work in but yes, just give me some time to refresh the library first so you're not working against outdated code. Yes, there are constraints mainly revolving around stability (this is a Top 1% most-depended-on npm library that has been stable for a decade). Another constraint is minimalism - supporting just the baseline, core requirements whilst enabling extension and personalisation. I'll get back to you.

@75lb
Copy link
Owner

75lb commented Jul 13, 2024

Closing as the test suite and tools have since been updated

@75lb 75lb closed this as completed Jul 13, 2024
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 a pull request may close this issue.

2 participants