Repository navigation
Support *.ts files for node --test #55078
Copy link
Copy link
Closed
Labels
feature requestIssues requesting new Node.js features.Issues requesting new Node.js features.strip-typesIssues and PRs related to TypeScript type stripping.Issues and PRs related to TypeScript type stripping.test_runnerIssues and PRs related to the test runner subsystem.Issues and PRs related to the test runner subsystem.
Description
Activity
- addedfeature requestIssues requesting new Node.js features.Issues requesting new Node.js features.
on Sep 23, 2024 - addedtest_runnerIssues and PRs related to the test runner subsystem.Issues and PRs related to the test runner subsystem.strip-typesIssues and PRs related to TypeScript type stripping.Issues and PRs related to TypeScript type stripping.
on Sep 23, 2024 This is already supported via
node --experimental-strip-types --test test.ts@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-typesas a flag to add also ts, cts, mts files? Thanks!Oh okay, that should a simple few-line fix.
I'll fix this later today if no one does so before me
Reacted by Petr Plenkov and Pietro Marchini
Metadata
Metadata
Assignees
Labels
feature requestIssues requesting new Node.js features.Issues requesting new Node.js features.strip-typesIssues and PRs related to TypeScript type stripping.Issues and PRs related to TypeScript type stripping.test_runnerIssues and PRs related to the test runner subsystem.Issues and PRs related to the test runner subsystem.
What is the problem this feature will solve?
I would like to use tests using typescript, not js. Currently if I run
node --testit finds nothing.What is the feature you are proposing to solve the problem?
node --testwould pick up also typescript files and execute them since typescript now is experimentally supportedWhat alternatives have you considered?
Of course tools like
jestorvitestcan 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.