I am trying to run my Jest Test while deploying Jenkins. If I ssh on the server, I can sudo in jenkins user ans to successfully run tests from the workspace. However, I get an error when trying to build a project from the GUI. Here is my project setup:
I installed the nodejs plugin and it installs gulp, jest-cli and babel globally. 
Then in the assembly steps:

This error failed:
TypeError: Cannot read property 'getResourceByPath' of null at Loader.getDependenciesFromPath (/var/lib/jenkins/workspace/PHPStaging/node_modules/jest-cli/src/HasteModuleLoader/HasteModuleLoader.js:570:39) at /var/lib/jenkins/workspace/PHPStaging/node_modules/jest-cli/src/TestRunner.js:250:22 at process._tickCallback (node.js:368:9) Running 6 test suites... FAIL resources/__tests__/myTest.js`
Node seems to have difficulty requiring modules to test, but I'm not quite sure. Any help or guidance would be appreciated.
Georgemayer
source share