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

Can't make it run when using vitest. #645

Open
yoniaiz opened this issue Nov 1, 2024 · 1 comment
Open

Can't make it run when using vitest. #645

yoniaiz opened this issue Nov 1, 2024 · 1 comment
Labels
help wanted Accepting PRs

Comments

@yoniaiz
Copy link

yoniaiz commented Nov 1, 2024

Hi!
I'm trying to run the tests using vitest and it does not seem to work.
I didn't create any vitest configuration, when i'm running the tests that use runCommand i'm getting the following error

stdout  (node:99331) [ERR_UNKNOWN_FILE_EXTENSION] Warning: TypeError
module: @oclif/[email protected]
task: findCommand (local)
plugin: test-reports-cli
root: /.../my-cli
code: ERR_UNKNOWN_FILE_EXTENSION
message: Unknown file extension ".ts" for .../src/commands/local.ts
See more details with DEBUG=*

Is there any guidance or known issues running the tests using vitest?

@mdonnalley mdonnalley added the help wanted Accepting PRs label Nov 7, 2024
@kanadgupta
Copy link
Contributor

@yoniaiz I've been able to get this library working with vitest. How are you executing your command? That looks like an error related to ts-node attempting to run ESM files. There are a lot of issues in the ts-node repo related to this: https://github.com/TypeStrong/ts-node/issues?q=ERR_UNKNOWN_FILE_EXTENSION+sort:reactions-+1-desc

I'd recommend using tsx or running your tests via npx vitest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Accepting PRs
Projects
None yet
Development

No branches or pull requests

3 participants