Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Testing guide

Miroslav Stastny edited this page Nov 1, 2018 · 7 revisions

Running tests

# Run tests with:
yarn test

# Run tests in watch mode with:
yarn test:watch

# Run single test in watch mode with:
yarn test: watch {test filename}
example: yarn test:watch button-test

Debugging tests

  1. Open Chrome DevTools and drag & drop the whole react/ repo directory there, then click allow

screen shot 2018-09-03 at 17 19 15

  1. Go to console and run:
node --inspect-brk node_modules/.bin/jest --runInBand [PATTERN_FOR_TEST_FILENAME]

       e.g.:

node --inspect-brk node_modules/.bin/jest --runInBand ChatList*
  1. Go to Chrome DevTools and click on the green button to open Dedicated DevTools for Node.js

screen shot 2018-09-03 at 17 20 20

  1. Press Ctrl+P to navigate to your test files, add breakpoints and resume execution
Clone this wiki locally