Files
pybricks-code/test
David Lechner 1515e5ae4f fileStorage: add file handles
This changes how files work. There is now an open function that
translates a path to a file handle (id). Then this handle is used
to perform other actions on the file. The file contents are moved
to a separate table so that the actual file storage is independent
of the database (e.g. in the future, we may use File Access API).

We store a hash of the file contents in the metadata file so we can
detect file changes without having to compare file contents.

We also separate the change and add actions.
2022-04-01 13:41:10 -05:00
..
2020-11-20 21:08:53 -06:00
2022-04-01 13:41:10 -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.