Skip to content
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

fix windows support #91

Merged
merged 4 commits into from
Feb 12, 2024
Merged

Conversation

Pineappletooth
Copy link
Contributor

@Pineappletooth Pineappletooth commented Nov 30, 2023

This plugin in windows has 2 issues:

  1. Jest only accepts paths with forward slash but the plugin sends it backwards as reported in Tests cannot be found on windows, due to usage of \ instead of / in the file path. #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 #44 (comment).

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

Copy link
Collaborator

@haydenmeade haydenmeade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, fix merge conflict then tag me and I'll merge it

@Pineappletooth
Copy link
Contributor Author

@haydenmeade done, thanks.

@bad4iz
Copy link

bad4iz commented Jan 24, 2024

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

@bad4iz
Copy link

bad4iz commented Jan 24, 2024

in my opinion, the second point does not work
image

image

@Pineappletooth
Copy link
Contributor Author

@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
Copy link

bad4iz commented Jan 26, 2024

yes it works. thanks
image

@bad4iz
Copy link

bad4iz commented Feb 11, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tests cannot be found on windows, due to usage of \ instead of / in the file path.
3 participants