-
-
Notifications
You must be signed in to change notification settings - Fork 154
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
test for .ts files not working #663
Comments
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Issues is a place for discussing solutions that can land in tsx. As per the Contribution guide, please avoid discussing work arounds here. If you can investigate a solution, please open a PR |
@ficu88 are you on a version of Node before v21? I'm on v20 and get the same behavior. If that's correct, perhaps the "fix" is to amend the docs to mention the Node version requirements for the test runner integration. Side note for the maintainer: Respectfully the two comments marked as off-topic were helpful for me. For those who can't upgrade to Node v21+ any workaround is useful! |
See the reproduction Node version:
Happy to accept a PR, would you be open to working on one?
As a maintainer, my priority is to serve sponsors first, then contributors, and finally users. For sponsors needing a workaround, I'm happy to offer support directly via the sponsors-only repo. The Issues tab is a place for contributors to collaborate and fix bugs to benefit all tsx users, and it's distracting/unproductive when the thread is polluted with workaround noise by non-contributors. |
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment has been minimized.
This comment has been minimized.
Node LTS v.20 here I run tests. For the following file tree:
this works: $ node --test src # is successfully executing the `src/commands.test.js` tests However for a similar TS location:
tsx doesn't find test files: $ npx tsx --test src # is finding 0 tests Yet if I pass the path it works: $ npx tsx --test src/commands.test.ts # is successfully executing the `src/commands.test.ts` tests
$ npx tsx --test src/*.test.ts # is successfully executing the `src/commands.test.ts` tests There is no such issue for Node v.21, but we're on the LTS Node v.20. So it seems to be a test files discovery issue. Maybe it's worth adding the appropriate info to the docs here? |
Yeah, feel free to open a PR to update the docs. Explanation is in the PR: #410 (comment) |
Acknowledgements
Minimal reproduction URL
https://stackblitz.com/edit/node-hzy2ii?file=package.json,bar.test.ts
Problem & expected behavior (under 200 words)
When you run
tsx --test
, the filebar.test.ts
is not executed.https://tsx.is/node-enhancement#test-runner
Bugs are expected to be fixed by those affected by it
Compensating engineering work will speed up resolution and support the project
The text was updated successfully, but these errors were encountered: