Search code examples
webstorm

WebStorm - customize the test command


enter image description here

As seen on the picture, WebStorm starts test via react-scripts test --testNamePattern=pattern However, given I use craco to override the webpack config, and that typically I use env-cmd to load environment variables (for example, env-cmd -f .env.staging && yarn test), I'd like to customize the test command.

For now, changing it to craco test --testNamePattern=pattern would be enough.

Is it possible?


Solution

  • Try setting node_modules/@craco/craco as Jest package: in your Jest run configuration:

    enter image description here