Files
pybricks-code/test
David Lechner 110d93860a test: add timeout to saga take
This will crash tests sooner and give a stack track at the crash point
instead of waiting the default 5 seconds for the entire test to timeout
(which doesn't give a stack trace of where the test was when it timed
out).
2022-03-28 11:48:08 -05:00
..
2020-11-20 21:08:53 -06:00
2022-03-28 11:48:08 -05:00

Testing

NOTE: This directory contains test helpers. Actual tests are in the src/ directory.

Running tests

yarn test

Launches the test runner in the interactive watch mode.

See the section about running tests for more information.

Code coverage

yarn coverage

Launches the test runner in the code coverage mode. Results are displayed in the terminal.

yarn coverage:html
xdg-open coverage/index.html

Does the same thing except results are converted to more detailed html pages in the coverage/ directory. (On macOS, use open and on Windows use explorer instead of xdg-open to open the html in your default web browser.)

Writing tests

Tests are written using the Jest testing framework.