Skip to content

Commit

Permalink
Add instructions for attaching debugger to jest
Browse files Browse the repository at this point in the history
  • Loading branch information
hypest committed Mar 16, 2018
1 parent 3d77fbd commit 966078f
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 966078f

Please sign in to comment.