You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My neovim/terminal gets absolutely bricked when I setup neotest-jest. I've identified the source of the issue as being the jest-util.getJestCommand function. This only happens when I am in a non-javascript project. I am only able to exit by forcefully killing the neovim process or my terminal entirely.
Here is my understanding of how this plugin is supposed to work: I set up my adapters for each language. The plugin will identify what kind of project I am in and use the corresponding adapter. Therefore, if I use the getJestCommand in my config, it should not run when I open a python project, since there shouldn't be a jest command to be found. Please correct me if I am wrong about how this works!
I can abate this behavior by putting in a guard statement at the top of the foundBinary function within getJestCommand:
functionM.getJestCommand(path)
localgitAncestor=util.find_git_ancestor(path)
localfunctionfindBinary(p)
-- NOTE: my addition, this guard statement prevents infinite recursion??ifp==nilthenreturnendlocalrootPath=util.find_node_modules_ancestor(p)
localjestBinary=util.path.join(rootPath, "node_modules", ".bin", "jest")
ifutil.path.exists(jestBinary) thenreturnjestBinaryend-- If no binary found and the current directory isn't the parent-- git ancestor, let's traverse up the tree againifrootPath~=gitAncestorthenreturnfindBinary(util.path.dirname(rootPath))
endendlocalfoundBinary=findBinary(path)
iffoundBinary~=nilthenprint('foundBinary : ' ..foundBinary)
endiffoundBinarythenreturnfoundBinaryendreturn"jest"end
Using nvm to manage node versions. I can verify that I have installed jest globally with npm list -g. I also had jest installed as a local dev dependency in this project in question as well. I used Lazy to update neotest, neotest-jest, and plenary to the latest version.
I typically start neovim (nvim .) from the root of the project, which had this general structure:
Also attaching a video. First I demonstrate that I am able to successfully open a Javascript project like normal. Tests can run and everything is dandy. Then I got to a Rust project and open neovim from the root directory. You can see the subsequent freezing/brick behavior.
screen_recording_20240505181153.mp4
The text was updated successfully, but these errors were encountered:
Hello there!
My neovim/terminal gets absolutely bricked when I setup
neotest-jest
. I've identified the source of the issue as being thejest-util.getJestCommand
function. This only happens when I am in a non-javascript project. I am only able to exit by forcefully killing the neovim process or my terminal entirely.Here is my understanding of how this plugin is supposed to work: I set up my adapters for each language. The plugin will identify what kind of project I am in and use the corresponding adapter. Therefore, if I use the
getJestCommand
in my config, it should not run when I open a python project, since there shouldn't be a jest command to be found. Please correct me if I am wrong about how this works!So with that in mind, here is my setup:
I can abate this behavior by putting in a guard statement at the top of the
foundBinary
function withingetJestCommand
:Here is my system:
OS: Arch Linux x86_64
Kernel: 6.8.7-arch1-1
CPU: Intel i5-10310U (8) @ 4.400GHz
GPU: Intel CometLake-U GT2 [UHD Graphics]
nvim version : 0.9.5
Using
nvm
to manage node versions. I can verify that I have installedjest
globally withnpm list -g
. I also had jest installed as a local dev dependency in this project in question as well. I used Lazy to updateneotest
,neotest-jest
, andplenary
to the latest version.I typically start neovim (
nvim .
) from the root of the project, which had this general structure:Also attaching a video. First I demonstrate that I am able to successfully open a Javascript project like normal. Tests can run and everything is dandy. Then I got to a Rust project and open neovim from the root directory. You can see the subsequent freezing/brick behavior.
screen_recording_20240505181153.mp4
The text was updated successfully, but these errors were encountered: