Failed to launch jest test for an electron application
I am using jest + spectron to test an electron application in Intellij. I am using IntelliJ ULTIMATE 2017.3 version. Below is the configuration page:

I got below errors when I launch the test. I am able to run the test from command line: `node_modules/.bin/jest --config=jest.json --testPathPattern=translator.test.js --runInBand --forceExit'. Can anyone tell me what wrong with my configuration?
```
/Users/joey/.nvm/versions/node/v8.9.1/bin/node --require "/Applications/IntelliJ IDEA.app/Contents/plugins/JavaScriptLanguage/helpers/jest-intellij/lib/jest-intellij-stdin-fix.js" /Users/joey/dev/dbkoda/dbkoda/node_modules/jest/bin/jest.js --config /Users/joey/dev/dbkoda/dbkoda/jest.json --runInBand --forceExit --colors --testResultsProcessor "/Applications/IntelliJ IDEA.app/Contents/plugins/JavaScriptLanguage/helpers/jest-intellij/lib/jest-intellij-test-results-processor.js" --testPathPattern ^/Users/joey/dev/dbkoda/dbkoda/src/tests/translator/translator\.test\.js$
events.js:183
throw er; // Unhandled 'error' event
^
Error: spawn find ENOENT
at _errnoException (util.js:1024:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
at onErrorNT (internal/child_process.js:372:16)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
at Function.Module.runMain (module.js:678:11)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3
Process finished with exit code 1
```
Please sign in to leave a comment.
Looks as if find binary can't be spawned as a child process because it's not on your
$PATH.Note that appending to
$PATHin Environment Variables field of your run configuration doesn't work - see https://youtrack.jetbrains.com/issue/IDEA-174463:$PATHis not expanded and appears verbatim, so the resultant$PATHis truncated. I'd suggest removing it from your run configuration - it makes things worse, not betterCan you check if the problem persist when running IDEA from terminal (
open -a /Applications/idea.app)?on MacOSX the environment variables differ between GUI applications and within the terminal. Terminal environment is only available to applications started from terminal. To solve this problem, IDEA tries to load terminal environment by executing the following command on startup:
Seems this command can't retrieve all needed stuff in your case - thus the issue.
Some links you may find useful: http://apple.stackexchange.com/questions/106355/setting-the-system-wide-path-environment-variable-in-mavericks, https://devnet.jetbrains.com/docs/DOC-1160#comment-2801, http://apple.stackexchange.com/questions/51677/how-to-set-path-for-finder-launched-applications.. The problem is that the way to define system-wide environment variables on Mac changes from one version to another (even minor system updates may break your environment)