diff --git a/frontend_tests/zjsunit/index.js b/frontend_tests/zjsunit/index.js index 46f81cc86a..98dfa25c99 100644 --- a/frontend_tests/zjsunit/index.js +++ b/frontend_tests/zjsunit/index.js @@ -114,7 +114,13 @@ try { namespace.finish(); } } catch (error) { - if (error.stack) { + if (process.env.USING_INSTRUMENTED_CODE) { + console.info(` + TEST FAILED! Before using the --coverage option please make sure that your + tests work under normal conditions. + + `); + } else if (error.stack) { console.info(short_tb(error.stack)); } else { console.info(error); diff --git a/tools/test-js-with-node b/tools/test-js-with-node index f7b808dd1d..ce0107cd1d 100755 --- a/tools/test-js-with-node +++ b/tools/test-js-with-node @@ -312,6 +312,7 @@ def run_tests_via_node_js() -> int: node_tests_cmd += test_files if options.coverage: + os.environ["USING_INSTRUMENTED_CODE"] = "TRUE" coverage_dir = os.path.join(ROOT_DIR, "var/node-coverage") nyc = os.path.join(ROOT_DIR, "node_modules/.bin/nyc")