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

Support *.ts files for node --test #55078

Closed
ThePlenkov opened this issue Sep 23, 2024 · 3 comments · Fixed by #55081
Closed

Support *.ts files for node --test #55078

ThePlenkov opened this issue Sep 23, 2024 · 3 comments · Fixed by #55081
Labels
feature request Issues that request new features to be added to Node.js. strip-types Issues or PRs related to strip-types support test_runner Issues and PRs related to the test runner subsystem.

Comments

@ThePlenkov
Copy link

What is the problem this feature will solve?

I would like to use tests using typescript, not js. Currently if I run node --test it finds nothing.

What is the feature you are proposing to solve the problem?

node --test would pick up also typescript files and execute them since typescript now is experimentally supported

What alternatives have you considered?

Of course tools like jest or vitest can do this out-of-the-box but I would really love to write native tests to have zero dependency on thridparty libraries, just pure node.

@ThePlenkov ThePlenkov added the feature request Issues that request new features to be added to Node.js. label Sep 23, 2024
@github-project-automation github-project-automation bot moved this to Awaiting Triage in Node.js feature requests Sep 23, 2024
@RedYetiDev RedYetiDev added test_runner Issues and PRs related to the test runner subsystem. strip-types Issues or PRs related to strip-types support labels Sep 23, 2024
@RedYetiDev RedYetiDev moved this from Awaiting Triage to Triaged in Node.js feature requests Sep 23, 2024
@RedYetiDev
Copy link
Member

This is already supported via node --experimental-strip-types --test test.ts

@RedYetiDev RedYetiDev closed this as not planned Won't fix, can't repro, duplicate, stale Sep 23, 2024
@ThePlenkov
Copy link
Author

@RedYetiDev correct, but it doesn't pick up *.test.ts files in the same way as it does for .js, cjs, mjs. as it is described here:

https://nodejs.org/api/test.html#running-tests-from-the-command-line

Can we --experimental-strip-types as a flag to add also ts, cts, mts files? Thanks!

@RedYetiDev RedYetiDev reopened this Sep 23, 2024
@RedYetiDev
Copy link
Member

RedYetiDev commented Sep 23, 2024

Oh okay, that should a simple few-line fix.

I'll fix this later today if no one does so before me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issues that request new features to be added to Node.js. strip-types Issues or PRs related to strip-types support test_runner Issues and PRs related to the test runner subsystem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants