From 651bf120fca2975e96e32dfbeedf9604c27e380e Mon Sep 17 00:00:00 2001 From: Simon Knox Date: Tue, 2 Apr 2019 16:24:26 +1100 Subject: Add jest debug script and update docs --- doc/development/testing_guide/frontend_testing.md | 2 +- package.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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", -- cgit v1.2.1