neotest-jest icon indicating copy to clipboard operation
neotest-jest copied to clipboard

Fixed: Tests cannot be found on windows, due to usage of `\` instead of `/` in the file path.

Open DasOhmoff opened this issue 3 years ago • 7 comments

Fixes #42

Should now work on all platforms, I assume

DasOhmoff avatar Oct 30 '22 06:10 DasOhmoff

By the way, vscode had a similar issue. Maybe this link is somehow helpful.

DasOhmoff avatar Oct 30 '22 06:10 DasOhmoff

@DasOhmoff Do you need to only do this in the case of windows? See https://github.com/firsttris/vscode-jest-runner/blob/0321cf70e21b5d541a66a670e3104b5cd30a4704/src/util.ts#L20

haydenmeade avatar Nov 02 '22 22:11 haydenmeade

I do think so, but I am not 100% sure. Maybe this might create a bug at some unexpected place, but yet I was not able to find anything like it.

DasOhmoff avatar Nov 06 '22 10:11 DasOhmoff

changing string.gsub(pos.path, '\\', '/') to vim.fs.normalize(pos.path) will achieve this slightly more idiomatically.

Too add to this. Yes it is only needed in the case of windows, but will leave other formats unaffected.

Would love to have this working on windows :)

brandonbarkerRAC avatar Feb 07 '23 08:02 brandonbarkerRAC

There's still a problem running tests on Windows, maybe this could be merged?

kipelovets avatar Oct 19 '23 21:10 kipelovets

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

bad4iz avatar Jan 24 '24 18:01 bad4iz

@bad4iz, have you tried running this locally as the vim.fs.normalize that was introduced in #91 should fix this issue.

There is a separate issue I believe regarding other special characters such as []() which I've addressed in a PR #109.

@haydenmeade, can this issue (#44) be closed?

conermurphy avatar Mar 19 '24 16:03 conermurphy