Closed alexrecuenco closed 3 months ago
@alexrecuenco, do you happen to have "jest.shell"
defined? Otherwise, it will default to 'bash' when trying to run a login-shell as you have discovered.
I guess we could enhance the extension to read vscode setting for the shell used by the terminal... but let's first make sure the "jest.shell"
works for your use case.
Regarding activating too early. It's not clear to me that there is a way to "wait" until the shell is fully initialized, as far as I know. The solution is usually just to start a "login shell" so the spawned jest process can initialize the env itself without relying on the parent process's env (vscode).
I am sorry, I am having a hard time reproducing this issue on the newest update. I am not sure if it was resolved, or if something about the workspace I am using is loading jest differently now.
that's all right. I am going to close it for now. Feel free to re-open it If you experience the same problem again and setting jest.shell
did not work.
Describe the bug If I start vscode by opening a window (macOS) vscode-jest executes instantly, before waiting for environment variables to resolve.
When that happens it returns
And it tries to use /bin/bash as a backup (Even though /bin/zsh is my default terminal
To Reproduce Steps to reproduce the behavior:
Set
"application.shellEnvironmentResolutionTimeout": 120
Write in your login shell script (.zshrc/ .bashrc/ etc)
sleep 2
Open a new window (not by running
code .
but by opening a workspace with code, I tried in my case with double clicking a.code-workspace
fileSee error above
Close that window
Open a new window with
code .
The error is no longer happening.
Expected behavior vscode-jest should wait for shell environment resolution before it tries to run, this extension starts faster than any other, and maybe too fast
If you use
Screenshots If applicable, add screenshots to help explain your problem.
Prerequisite
npm test
Additional context
If you start a new window with
code .
it works, since environment resolution happens before you open the window