nvim-neotest / neotest-jest

MIT License
116 stars 79 forks source link

fix windows support #91

Closed Pineappletooth closed 6 months ago

Pineappletooth commented 9 months ago

This plugin in windows has 2 issues:

1) Jest only accepts paths with forward slash but the plugin sends it backwards as reported in #42

2) After solving the first issue i noticed that neotest doesn't update the sign for each test making every test appear with an X even if the test passed. This is caused due to the test having an id like c:\\path\file::test_name and the Jest output reports the path like C:\\path\file::test_name (notice the capital drive) It seems that neotest now respects the case of the test id so this is no longer an issue.

This PR attemps to solve both issues.

First issue was solved using vim.fs.normalize as recommended in https://github.com/nvim-neotest/neotest-jest/pull/44#issuecomment-1420417168.

Second issue was solved adding a windows only validation that changes the case of the drive.

Tested in windows everything works as expected. Should not cause any issue in other platforms.

Fixes #42 Supersedes #44

Pineappletooth commented 8 months ago

@haydenmeade done, thanks.

bad4iz commented 7 months ago

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

bad4iz commented 7 months ago

in my opinion, the second point does not work image

image

Pineappletooth commented 7 months ago

@bad4iz Thanks for the report, i updated my dependencies and it seems that the second point was fixed in another place (probably in the neotest repo) and now the original test id respects the drive case, so the windows specific hack is no longer needed.

I removed it and everything seems to be working as expected again. Could you try and confirm please?

bad4iz commented 7 months ago

yes it works. thanks image

bad4iz commented 6 months ago

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