summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Knox <psimyn@gmail.com>2019-04-02 16:24:26 +1100
committerSimon Knox <psimyn@gmail.com>2019-04-02 17:27:12 +1100
commit651bf120fca2975e96e32dfbeedf9604c27e380e (patch)
tree860e101e8fc4f62d63dbf02a323603330a935420
parentf92977960256c99dcfc21a13bc9d6f671f546cb0 (diff)
downloadgitlab-ce-docs-jest-debug.tar.gz
Add jest debug script and update docsdocs-jest-debug
-rw-r--r--doc/development/testing_guide/frontend_testing.md2
-rw-r--r--package.json1
2 files changed, 2 insertions, 1 deletions
diff --git a/doc/development/testing_guide/frontend_testing.md b/doc/development/testing_guide/frontend_testing.md
index 3cee301465d..f58a8dcbcdc 100644
--- a/doc/development/testing_guide/frontend_testing.md
+++ b/doc/development/testing_guide/frontend_testing.md
@@ -28,7 +28,7 @@ we need to solve before being able to use Jest for all our needs.
### Debugging Jest tests
-The [Jest docs](https://jestjs.io/docs/en/troubleshooting#tests-are-failing-and-you-don-t-know-why) show how to debug tests. We also need to pass `BABEL_ENV=jest` environment variable, e.g. `BABEL_ENV=jest node --inspect-brk node_modules/.bin/jest --runInBand`
+Running `yarn jest-debug` will run Jest in debug mode, allowing you to debug/inspect as described in the [Jest docs](https://jestjs.io/docs/en/troubleshooting#tests-are-failing-and-you-don-t-know-why).
### Timeout error
diff --git a/package.json b/package.json
index 90fcfe01438..fc8d8a5ef47 100644
--- a/package.json
+++ b/package.json
@@ -7,6 +7,7 @@
"eslint-fix": "eslint --max-warnings 0 --report-unused-disable-directives --ext .js,.vue --fix .",
"eslint-report": "eslint --max-warnings 0 --ext .js,.vue --format html --output-file ./eslint-report.html --no-inline-config .",
"jest": "BABEL_ENV=jest jest",
+ "jest-debug": "BABEL_ENV=jest node --inspect-brk node_modules/.bin/jest --runInBand",
"jsdoc": "jsdoc -c config/jsdocs.config.js",
"karma": "BABEL_ENV=${BABEL_ENV:=karma} karma start --single-run true config/karma.config.js",
"karma-coverage": "BABEL_ENV=coverage karma start --single-run true config/karma.config.js",