vscode-jest
vscode-jest copied to clipboard
Question: Is there a way to add `pretest` and `posttest` hooks?
My Jest tests require setup and teardown procedures that I currently configure in yarn pretest
and yarn posttest
respectively. Is there a way to make this plugin respect that?
This is documented in jestCommandLine
if you uses npm, add an additional "--" at the end (e.g. "npm run test --")
At least with npm, assuming you have your pretest script defined, this would effectively configure vscode-jest to run the pretest script.
.vscode/settings.json
:
{
"jest.jestCommandLine": "npm test --"
}
While I'm not as familiar with yarn, I expect there's a similar analog here