Let's imagine that we have CodeBuild project defined by buildspec file which is dependent on the environment variable in the following manner:
'if [ "${VERIFICATION}" = "YES" ]; then ' +
'npm run test ; ' +
'fi'
From this code it is clear that tests will be executed only when the condition is true. In the same time buildspec file contains the defined test reports which should be skipped when the tests are not run, otherwise the build will fail as it will not be able to copy the reports.
Question: how to skip test reports when the tests are not run?