Skip to main content

Troubleshooting

Jest hangs after running tests

You may have open handles preventing Jest from exiting cleanly. You can check it with --detectOpenHandles or force exit with --forceExit:

$(npm bin)/knapsack-pro-jest --detectOpenHandles

$(npm bin)/knapsack-pro-jest --forceExit

Also, make sure node has enough heap memory on your CI.

JavaScript heap out of memory

You can increase the memory available to Node with --max_old_space_size:

export NODE_OPTIONS=--max_old_space_size=4096

$(npm bin)/knapsack-pro-jest

$(npm bin)/knapsack-pro-cypress

Debug Knapsack Pro on your development environment/machine

To reproduce what Knapsack Pro executed on a specific CI node, check out the same branch and run:

KNAPSACK_PRO_TEST_SUITE_TOKEN_JEST=MY_TOKEN \
KNAPSACK_PRO_CI_NODE_INDEX=MY_INDEX \
KNAPSACK_PRO_CI_NODE_TOTAL=MY_TOTAL \
KNAPSACK_PRO_BRANCH=MY_BRANCH \
KNAPSACK_PRO_COMMIT_HASH=MY_COMMIT \
KNAPSACK_PRO_CI_NODE_BUILD_ID=MY_BUILD_ID \
KNAPSACK_PRO_FIXED_QUEUE_SPLIT=true \
KNAPSACK_PRO_TEST_FILE_PATTERN="{**/__tests__/**/*.js?(x),**/?(*.)(spec|test).js?(x)}" \
$(npm bin)/knapsack-pro-jest --runInBand

KNAPSACK_PRO_CI_NODE_BUILD_ID must be the same as the CI build you are trying to reproduce (if it helps, take a look at what Knapsack Pro uses as ciNodeBuildId for your CI provider).

No tests are executed (or test_files: [ 'parameter is required' ])

Make sure KNAPSACK_PRO_TEST_FILE_PATTERN is correct.

This site uses cookies. By staying here you accept them. See our Cookie Policy for details.
For more information on how to turn off the use of cookies, please see this.
To refuse the use of cookies, please leave the page (more details here).