Open eugeny-dementev opened 5 months ago
I had the same issues with running the tests locally, raised an issue for it here #114 to try get some help from others.
I'm using Neovim in Windows 11 with PowerShell 7.4.1 and it only works for me after I apply your code and remove the escapeTestPattern
call.
I'm using Neovim in Windows 11 with PowerShell 7.4.1 and it only works for me after I apply your code and remove the
escapeTestPattern
call.
I've encountered the same issue. To fix this I've had to gsub out the backslash characters for it to work. It seems to normalize the path to C:\/....\/.... which windows does not like.
escapeTestPattern(reducePattern(cwd, pos.path)):gsub("\\", ""),
Fix for https://github.com/nvim-neotest/neotest-jest/issues/113
There are few issues with it on windows:
vim.fn.expand("%")
works on windows and unix: for file__tests__/file.test.ts
in nvim running command:lua =vim.fn.expand("%")
will show unix:__tests__/file.test.ts
windows:C:/project\__tests__/file.test.ts
neotest
uses that internal function to get current file and pass result to adaptersSolution in the PR is to reduce windows version of path to the same pattern it is for unix:
C:/project\__tests__/file.test.ts
=>__tests__/file.test.ts
.Fix is universal, on unix
vim.fn.substitute
(string replace) just doesn't do anything since path already lackingcwd
partI've tested it on both windows and ubuntu and it seem to work as intended on both platforms
Help needed with writing tests because
./scripts/test
throws an error for me so I have no idea if I broke something