mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 01:23:52 +00:00
This uses the real rootReducer to populate the initial state in the test AsyncSaga. This way we don't have to populate default values. Since it isn't used often, we can omit the parameter and just call the updateState() method after creating the object if modifications are needed.
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.