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

TypeError: Cannot read properties of undefined when refreshing Pester tests #279

Open
gerardmchale opened this issue Dec 5, 2024 · 1 comment

Comments

@gerardmchale
Copy link

I am using VS Code for my PowerShell development. I have version 5.1 of PowerShell and version 1.95.3 of VS Code. I have the Pester extension installed in VS Code (version v2023.7.7). Until recently, I've had no issue with this extension but in the last few days whenever I try to refresh my Pester tests in VS Code I get the popup with the error message Cannot read properties of undefined (reading 'controllerId').

I have attached the log file Pester_extension_logs.log showing the full output from the VS Code.

I also noticed that if I try to run the tests after getting the error message above they will run but I get some strange errors that don't make any sense (e.g. functions not available for imported modules and directories not available even though they exist on the local machine).

If I run the same Pester tests from the command line, they pass without any problems, which suggests that the problem is not in the Pester tests but in the VS Code extension.

I have tried:

  • Restarting VS Code
  • Reinstalling the Pester extension
  • Disabling all other extensions
  • Reverting my code to an old version where I never saw the problem occur
@JustinGrote
Copy link
Collaborator

Thanks for your submission! The test discovery needs a little bit of a rework, but have you tried it with PS7 and the latest version of pester? That's what I test the most against, 5.1 is best effort support.

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

No branches or pull requests

2 participants