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

No tests found error in react project with create-react-app #74

Open
giuxtaposition opened this issue Sep 5, 2023 · 7 comments
Open

Comments

@giuxtaposition
Copy link

As the title says, the current strategy of checking that jest is a dependency in the package.json does not work with project bootstrapped with create-react-app because jest is included as a dependency of react-scripts.

As a workaround I added it as explicit dependency in my project, but isn't there a better solution?

@Jamie-505
Copy link
Contributor

Jamie-505 commented Sep 25, 2023

Hi @giuxtaposition,
you can check out my PR #80 and see if that might help in your case

@Zik42
Copy link

Zik42 commented Jan 16, 2024

@Jamie-505 Good, but it does not suit case with default create-react-app case. It should read nested dependencies, or try to run yarn test command to determinate test runner. I tried you fork.

@bad4iz
Copy link

bad4iz commented Jan 24, 2024

this is very relevant and necessary. How are things progressing on this issue?

@weilbith
Copy link

weilbith commented Feb 21, 2024

I can get the detection to work if I locally adapt the package.json dependency detection. But unfortunately I can't get it to read the right Jest configuration. At least it is unable to parse the TypeScript (Jest error when running a test).

@rguruprakash
Copy link
Contributor

rguruprakash commented Feb 26, 2024

Maybe I didn't get it completely. but why do we need jest detection to determine if something is a test file? isn't the pattern matching here enough?

I removed jest detection from my local branch and it works great. (I work on 3 considerable-sized typescript projects and one of them is mono repo)

@weilbith
Copy link

weilbith commented Feb 28, 2024

Maybe I didn't get it completely. but why do we need jest detection to determine if something is a test file? isn't the pattern matching here enough?

I don't think so. That is just a file name pattern, right? There are many other testing frameworks which use similar naming concepts. Like Vitest for example (very related I know, but would be a different neotest adapter).

@rguruprakash
Copy link
Contributor

@weilbith Thanks. I get it now.

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

6 participants