-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Current working location differs between Run and Debug #110
Comments
Thanks for the detailed report! The starting directory is a little tricky especially if you are using a workspace with multiple project roots, but it makes sense for it at least to use the base. I never run into this problem becaues I use |
Thank you for your reply and advice! Also, thank you for adding to your Roadmap. I agree that it's a good idea to use the However, it's just my personal context, but there are some codes previously wrote which depends on the current location and I should maintain them. So it would be helpful for me if the location when "Run Tests" will be the same as when "Debug Tests". |
Implemented in #119. It is an explicit setting, I wanted to avoid "magic" behavior with the terminal integrated console cwd hijacking it unexpectedly, and some more thinking needs to go into multi-root workspaces around this. |
Sorry for the late reply. |
Recently I started using this vscode-adapter. I found its integration into VS Code's GUI so great. Thank you for developing the amazing software 😆
Description
The current working location differs depending whether do "Run Tests" or do "Debug Tests". You can see this difference with the Get-Location cmdlet. Since the current working location is different, the results of tests that depends location, such as tests including Import-Module cmdlet, will change between Run and Debug. I guess it is desirable that the test results are the same regardless of "Run Tests" or "Debug Tests".
Related Issue
Maybe this issue is related to issue #89. If you think this issue should merge to #89, feel free to do it.
NOTE: The
cwd
configuration discussed in #89 not affected the behavior of this issue. The configuration I tried:My environment
Reproduction procedure
unzip attached powershell_pester_location_bug.zip
launch VS Code on
project_root_folder
folderyou can see the files in "Explorer" view like below
move on "Testing" view and do "Debug Test"
you can see the green checks showing the test passed
stay on "Testing" view and do "Run Tests"
you can see the red checks showing the test failed
you can see the error shows the current working location is not
project_root_folder
When I do "Run Tests", current working location seems to
Microsoft VS Code
folder.Expected behavior
I guess the behavior of "Debug Tests" is correct, but the behavior of "Run Tests" is incorrect. The current location should also be the project root when I do "Run Tests". This is the same behavior as Pester's
Invoke-Pester
cmdlet.The text was updated successfully, but these errors were encountered: