From b51faeefa1b815fb949bdcf60026d6275b4847d4 Mon Sep 17 00:00:00 2001
From: "Mark A. Matney, Jr" <mmatney@library.ucla.edu>
Date: Wed, 14 Apr 2021 15:25:21 -0700
Subject: [PATCH] Add npm script for running the test suite in a debugger
 (#3415)

---
 README.md    | 16 +++++++++++++++-
 package.json |  1 +
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 0799ad78e..716c06062 100644
--- a/README.md
+++ b/README.md
@@ -85,6 +85,20 @@ $ npm run lint
 ```
 
 ## Debugging
-Useful browser extensions for debugging/development purposes
+
+### Local instance
+
+The following browser extensions are useful for debugging a local development instance of Mirador:
+
  - [React DevTools](https://github.com/facebook/react-devtools)
  - [Redux DevTools](https://github.com/zalmoxisus/redux-devtools-extension)
+
+### Test suite
+
+To debug the test suite, run:
+
+```sh
+$ npm run test:debug
+```
+
+then spin up a [nodejs inspector client](https://nodejs.org/en/docs/guides/debugging-getting-started/#inspector-clients) and set some breakpoints. See [here](https://www.digitalocean.com/community/tutorials/how-to-debug-node-js-with-the-built-in-debugger-and-chrome-devtools#step-3-%E2%80%94-debugging-node-js-with-chrome-devtools) for a guide to debugging with Chrome DevTools.
diff --git a/package.json b/package.json
index 1b00a9c50..e1527a7e2 100644
--- a/package.json
+++ b/package.json
@@ -15,6 +15,7 @@
     "lint:translations": "node ./scripts/i18n-lint.js",
     "server": "node_modules/.bin/http-server --cors",
     "test": "npm run build && npm run lint && npm run size && jest -c jest.json",
+    "test:debug": "node --inspect node_modules/.bin/jest -c jest.json --runInBand",
     "test:watch": "jest -c jest.json --watch",
     "build": "NODE_ENV=production webpack --mode=production",
     "build:dev": "webpack --mode=development",
-- 
GitLab