When developing a projects, it's useful to run tap in watch mode. In this mode, tap will watch your project for changes to test files and the program files that they cover, and open a repl (Read, Eval, Print Loop) to control the process.
To run tap in watch mode, run
tap --watch or
Watching files for changes requires that coverage is enabled, because it uses NYC to determine which test is relevant to which file being changed.
At the start of the watch process, tap runs the full test suite. Thereafter, it automatically runs the files that are necessary as they change.
Any tests that fail will be re-run on the next file change, even if they are not connected to the file that changed.
Run test suite again, or just run the supplied filename. (Use this to add
tests to the suite, if they're not already being watched.)
Update snapshots in the suite, or in the supplied filename. This supplied
file will be added to the suite if it's not already included.
Run the suite with
--changed. This is
useful when resuming after a pause.
Pause/resume the file watcher.
c [<report style>]
Run coverage report. Default to 'text' style.
Exit the repl. You can also use
Ctrl-D to terminate the repl,
if a test run is not in progress.
Delete all coverage info and re-run the test suite.
Clear the screen.
Due to the way that tap detects which files are covered by each change, new files that are added to the test suite will not automatically be detected by the watcher.
r <filename> or
u <filename> commands to add them to the suite.
If you specify a
option, then you can be very precise about which files under test should
trigger a re-run of the tests.