Skip to content

Commit

Permalink
Merge pull request #8 from Automattic/feature/add-jest-debugger-info-…
Browse files Browse the repository at this point in the history
…in-readme

Add README.md instructions for attaching debugger to jest
  • Loading branch information
maxme authored Mar 16, 2018
2 parents 83cf8c0 + 966078f commit 014ca8c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ yarn start -- --reset-cache

Runs the [jest](https://github.com/facebook/jest) test runner on your tests.

To run `jest` with debugger support, start it with the following CLI command:
```
NODE_ENV=test node --inspect-brk node_modules/.bin/jest --runInBand
```

Append `--config <jest config json file>` to specify a config file other than the default.

Then, open `chrome://inspect` in Chrome to attach the debugger (look into the "Remote Target" section). While testing/developing, feel free to springle `debugger` statements anywhere in the code that you'd like the debugger to break.

#### `npm run ios`

Like `npm start`, but also attempts to open your app in the iOS Simulator if you're on a Mac and have it installed.
Expand Down

0 comments on commit 014ca8c

Please sign in to comment.