From dd7c80bee8112e2769193ff36d4aff8acb3a95ea Mon Sep 17 00:00:00 2001 From: Joshua Nussbaum Date: Fri, 7 Oct 2022 04:03:01 -0400 Subject: [PATCH] docs: add instructions for debugging tests via terminal (#2085) Co-authored-by: Anjorin Damilare --- docs/guide/debugging.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/guide/debugging.md b/docs/guide/debugging.md index 9fef01e8de30..5a19ee981884 100644 --- a/docs/guide/debugging.md +++ b/docs/guide/debugging.md @@ -4,6 +4,21 @@ title: Debugging | Guide # Debugging +## Terminal + +To debug a test file without an IDE, you can use [`ndb`](https://github.com/GoogleChromeLabs/ndb). Just add a `debugger` statement anywhere in your code, and then run `ndb`: + +```sh +# install ndb globally +npm install -g ndb + +# alternatively, with yarn +yarn global add ndb + +# run tests with debugger enabled +ndb npm run test +``` + ## VSCode To debug a test file in VSCode, create the following launch configuration.