Node-tap includes a REPL that can be used to do various things.
Starting the REPL#
To start the REPL, run
You can have it immediately execute a command by running
tap repl <command>.
tap repl help will print the list of commands and
To run tests normally, like doing
tap run or
tap run <file>,
To run the tests and update snapshots (assuming the
@tapjs/snapshot plugin is enabled),
To run tests that have changed since the last test run, type
To run tests that failed in the last test run, type
f. If there
are no prior failures, then this runs all tests.
Watching for Changes#
To automatically run affected tests any time files change, type
w. This toggles the watcher on or off, and prints an update
about the current watch status. You can run
w on or
w off to
set it explicitly.
You can use
plugin [add <plugin> | rm <plugin> | list] to
interact with tap plugins, just like the
To get a list of the tests that failed the previous run, type
To get the current watch status, type
To get a coverage report for the most recent test run, type
You can also specify the style with
c <style>, for example,
c html to open the HTML report in a browser.
You can inspect tap's process info database using the
command. For example,
i test/foo.ts will show information
about the most recent run of the
test/foo.ts test process. You
can also provide a uuid to the
i command to get information
about parent and child processes.
version prints the current tap version, and
the version of tap and all submodules and plugins.
list will print a list of the test files that will be included
in the test run.
config will show the configuration currently in use. You can
config get, and
config edit the same as the
parse command will let you type in
data and then print information about how it
tap <command ...> will run the
in a subprocess and print the exit status, so if anything is
missing here but provided in the CLI, you can use it that way.