-
Notifications
You must be signed in to change notification settings - Fork 84
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
Jest Command Based on Project #86
Comments
Although not exactly what you are looking for, but you could use ni to automatically use the correct package manager. For example running ‘nr test —‘ will run your test regardless of your package manager. |
Thanks, but was hoping to not have another toolchain. I might go with this but hoping for another solution |
Not sure if this is still relevant but the jestCommand = function(path)
local cwd = vim.fn.getcwd()
if vim.endswith(cwd, 'my-special-project') then
return "yarn test"
end
return "npm test"
end You might also be able to adapt some of the code for |
@MisanthropicBit interesting. Maybe I could check for lock file. |
Not an issue per-say but wondering how people configure their jest command when you have projects that use npm, some that use yarn, etc... Do you change your config? Or is there a dynamic way?
Update 1:
I think when I made this ticket, I was bad in not adding a thought on a solution. What if we do something like not pass
jestCommand
and have another property that is something like:With this, what the plugin can do is check in the root dir of project, is there a package-lock, or yarn.lock, or pnpm-lock? Then it could build the
jestCommand
from thatThe text was updated successfully, but these errors were encountered: