Jest test artifacts

Hey there! I’m trying to get artifacts from Jest, but I’m not having success.

For the record, I have a React Native project and I’m successfully test it, but I can’t move the artifacts from the output folder to the CIRCLE_ARTIFACTS folder. It looks like the environment variable is blank…

Here are my NPM scripts:

"test": "jest --coverage --coverageDirectory testArtifacts", "posttest": "mv ./testArtifacts/lcov-report/* $CIRCLE_ARTIFACTS"

Just after the tests succeeds, I get this error mv: target ‘./testArtifacts/lcov-report/sorter.js’ is not a directory

And if I try to just echo $CIRCLE_ARTIFACTS it just echoes an empty line…

What’s happening? I did not override it in my .circleci/config.yml file…

I also had this issue, I think it’s because $CIRCLE_ARTIFACTS is not defined in version 2 tests.

See: https://circleci.com/docs/2.0/collect-test-data/