From 7cfe5c13e389a59f5907df4815cc96c6e2843c67 Mon Sep 17 00:00:00 2001 From: Andrew Levine Date: Sun, 23 Oct 2016 22:58:25 -0500 Subject: [PATCH] Add TEST_DEBUG env var option for test.sh, to enable node 6 debugger (#4764) --- CONTRIBUTING.md | 6 ++++++ scripts/test.sh | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7259149149..4d38b69a5e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -115,6 +115,12 @@ Use the `TEST_GREP` variable to run a subset of tests by name: $ TEST_GREP=transformation make test ``` +To enable the node debugger added in v6.3.0, set the `TEST_DEBUG` environment variable: + +```sh +$ TEST_DEBUG=true make test +``` + To test the code coverage, use: ```sh diff --git a/scripts/test.sh b/scripts/test.sh index c817012d50..e9893371da 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -5,4 +5,10 @@ if [ -z "$TEST_GREP" ]; then TEST_GREP="" fi -node node_modules/mocha/bin/_mocha `scripts/_get-test-directories.sh` --opts test/mocha.opts --grep "$TEST_GREP" +node="node" + +if [ "$TEST_DEBUG" ]; then + node="node --inspect --debug-brk" +fi + +$node node_modules/mocha/bin/_mocha `scripts/_get-test-directories.sh` --opts test/mocha.opts --grep "$TEST_GREP"