-
Notifications
You must be signed in to change notification settings - Fork 36
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 if test is outside of __tests__
directory
#22
Comments
__tests__
directory is in the root__tests__
directory
Hi @h0adp0re! I tried to repro your case and everything works fine (as you can see in the picture below). Can you tell me if you are experiencing any problems discovering the tests or running them? Do you see the tests in the summary panel? The order in which the adapter checks for the existence of the tests folder should not affect the result of the is_test_file function. |
Hey, that's strange. I found that after saving the file once, everything works as expected, but only for that file. But, let's pretend I don't save the file first nor delete anything. The summary panel actually does show 2 directories — I tested a bit and here are some summary panel observations:
After the initial run via the summary panel comes the interesting part:
Sounds like some initialization or perhaps an autocommand problem on my side? Edit: I tried to make the text more structured, hope it's not too confusing. |
Alright well, thanks @AlexandrosAlexiou! #43 helped fix this issue for me. I simply told Although I would like to confirm that I'm using this correctly. Is the adapters = {
require("neotest-vitest")({
is_test_file = function(file_path)
if string.match(file_path, "my-project") then
return string.match(file_path, "/src/")
end
return true
end,
}),
}, And more, reading the source suggests that this check runs in addition to the usual checks? neotest-vitest/lua/neotest-vitest/init.lua Lines 430 to 435 in c0ea475
|
We have a
__tests__
folder in the root of our project for legacy reasons and the actual tests for our components are in the components' sub-folders withinsrc
. How to proceed?Edit: you should probably check whether the filename contains
spec
ortest
before checking whether the file is in__tests__
.The text was updated successfully, but these errors were encountered: