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

Deprecate test npm package #928

Open
RedYetiDev opened this issue Oct 22, 2024 · 11 comments
Open

Deprecate test npm package #928

RedYetiDev opened this issue Oct 22, 2024 · 11 comments

Comments

@RedYetiDev
Copy link
Member

The test npm package serves as a backport of the node:test module for Node.js versions prior to v18. However, all these older versions are now end-of-life (EoL). This means the package offers no real advantage for users running supported (non-EoL) versions of Node.js, which they ideally should be using.

Given that the package is outdated and no longer necessary, wouldn't it make sense to deprecate it?

CC @nodejs/test_runner

@cjihrig
Copy link

cjihrig commented Oct 22, 2024

Alternative take: it would be great to bring that module up to date. The delta between node:test on v18 vs. v23 is substantial.

@RedYetiDev
Copy link
Member Author

RedYetiDev commented Oct 22, 2024

Alternative take: it would be great to bring that module up to date. The delta between node:test on v18 vs. v23 is substantial.

That could be done, I just feel that there should be a point where this module reaches the end of its lifespan. IMHO it shouldn't be a polyfill/shim forever.

Maybe it's okay now that the test runner was added recently, but in a few years, maybe this module should eventually be deprecated.

@RedYetiDev
Copy link
Member Author

I've looked into upgrading the package, and I'm afraid it's not that simple. The test runner now makes use of internalBinding (which can fairly easily be polyfilled to produce the same result), and internal/modules/esm/loader, which is less straightforward to polyfill.

@cjihrig
Copy link

cjihrig commented Oct 25, 2024

internal/modules/esm/loader, which is less straightforward to polyfill.

In userland code, it might be enough to use dynamic import.

@juliangruber
Copy link
Member

Last time I tried upgrading the test package I gave up because I ran out of time & energy

@aduh95
Copy link
Contributor

aduh95 commented Oct 26, 2024

Yeah because that package is using a different set of lint rules, there are lots of conflicts to fix every time we try to backport something. At this point, we should probably disable the linter on files maintained on nodejs/node. (or indeed, deprecate the package)

@RedYetiDev
Copy link
Member Author

RedYetiDev commented Oct 26, 2024

I also tried upgrading, but there are so many things that are extremely complicated to include.

(My progress: 34/35 passing tests)
The following features are currently unsupported:

  • Importing reporters/custom modules from node_modules within a different directory than the test module
  • Setting global hooks using --require or --import when process isolation is none and multiple files are to be executed
  • Coverage
  • File watching
  • Module mocking
  • Source map caching

@RedYetiDev
Copy link
Member Author

Okay. I've upgraded the package to v23, but with the amount of work it took, and the likelyhood of it being out-of-date again in only a few months, I still think deprecation is the way to go.

@bnb
Copy link
Contributor

bnb commented Nov 6, 2024

hey! Just ran into this with one of my older packages.

I'd strongly urge us to keep this going, as it does allow for the option to decouple your tests from your runtime - having to do test and runtime upgrades at the same time does add burden, and being able to swap over to test or just always use test really smooths out that pain point.

Further, generally people update their runtime less frequently than they update their dependencies. Having the separate package enables people to get newer features from the test runner "sooner", which will help adoption of the tooling generally.

@bnb
Copy link
Contributor

bnb commented Nov 6, 2024

I am happy to dedicate time to this where I'd be helpful, but I'm not actually sure if I the technical context for the native bits of the test suite as it exists now.

@RedYetiDev
Copy link
Member Author

See nodejs/node-core-test#54 for the upgrade, if you'd like to dedicate time, reviews would be nice ❤️

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

No branches or pull requests

5 participants