-
-
Notifications
You must be signed in to change notification settings - Fork 106
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
[BUG] No test found #348
Comments
I had a similar issue where I had a supposedly good configuration, and a "no tests found" error. My mistake was to not have ran |
I am having a hard time running Jest tests in a Typescript/Node.js project since two days ago, it was working perfectly until then. Neotest can identify the test files correctly as they show up in the summary view, but when trying to run them it always give me a "No tests found" message. I also have Treesitter installed for Typescript. My coworker is having the same problem and we do not exchange configurations, we both use slightly modified versions of LazyVim. I had not much time to dig into this, but I did some debugging and it looks like an issue when the Jest adapter tries to get the nearest test node to run. I am not sure exactly where the problem is so I am just posting this message here for visibility, in case someone else also have this issue. |
@marcoskichel i have the same issue, started a couple of days ago. tests are detected correctly in Neotest log contains warning
looks like Typescript treesitter has parsing issues |
there's specific Typescript issue in |
Here to confirm that on version
This is all fixed by reverting to |
After upgrading neovim to 0.9.5(latest stable), test cases back to normal. |
@codycjy I upgraded to Neovim |
@fnune Am I correct in saying that's only for typescript? Everything is working well for me with python and lua |
It's for all adapters (at least for me). There may be more things involved, but downgrading to |
Ah OK, could you paste the output of the logs at debug level? |
Update: you were right @rcarriga it's only TypeScript. It turns out my Python test discovery was failing because my project also contains TypeScript. When I removed the Suggestion: cover against failures in test discovery from one adapter so that the other adapter still works? Also, the discovery failure was invisible to me as a user. The Here are some logs from my TypeScript problem: Neovim version:
Neotest version: https://github.com/nvim-neotest/neotest/commits/f6048f32be831907fb15018af2688ff6633704fc Treesitter version: https://github.com/nvim-treesitter/nvim-treesitter/commits/17d68ac13c902f55253b7facb47df4c0ae532575 Behavior when trying to run a test (2nd try; 1st try does not return any output): Logs on the 1st try (TSX):
Logs on the 2nd try (TSX): no additional logs, directly posts "No tests found". |
I dug into the specific problem for neotest-jest and found it to be what looks like a breaking change in the javascript treesitter parser: nvim-neotest/neotest-jest#100. I know there were some breaking highlighting changes in treesitter lately. Not sure if there were other breaking changes introduced as well. This problem was not impacting my other projects that did not have any typescript/javascript within them but my neotest-jest adapter was also the very last one in the list. Not sure if adapter ordering could be the cause of @fnune's problem? |
Placing Repeating the workaround in case it's helpful to others: pinning |
Looks like it a bug in |
NeoVim Version
Output of
nvim --version
NVIM v0.8.2
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by runner@fv-az190-151
Features: +acl +iconv +tui
See ":help feature-compile"
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/share/nvim"
Run :checkhealth for more info
Describe the bug
When try to show test us :NeotestSummary error occurs and no test function showed.
To Reproduce
Please provide a minimal
init.lua
to reproduce which can be run as the following:You can edit the following example file to include your adapters and other required setup.
Steps to reproduce the behavior:
:NeotestSummary
Please provide example test files to reproduce.
Expected behavior
Show all test function correctly
Logs
neotest.log
file instdpath("log")
orstdpath("data")
.log_level = vim.log.levels.DEBUG
in your neotest setup config.Additional context
The code doesn't work on wsl but works fine in my arch linux.
The text was updated successfully, but these errors were encountered: