Scroll to navigation

RUN.JS(1) User Commands RUN.JS(1)

NAME

run.js - Test-Anything-Protocol module for Node.js

DESCRIPTION

Usage:

tap [options] <files>

Executes all the files and interprets their output as TAP formatted test result data.

To parse TAP data from stdin, specify "-" as a filename.

Short options are parsed gnu-style, so for example '-bCRspec' would be equivalent to '--bail --no-color --reporter=spec'

If the --check-coverage or --coverage-report options are provided, but no test files are specified, then a coverage report or coverage check will be run on the data from the last test run.

Coverage is never enabled for stdin.

OPTIONS

Run up to <n> test files in parallel Note that this causes tests to be run in "buffered" mode, so line-by-line results cannot be reported, and older TAP parsers may get upset.
Run test files in parallel (auto calculated) Note that this causes tests to be run in "buffered" mode, so line-by-line results cannot be reported, and older TAP parsers may get upset.
Only run subtests tests matching the specified
pattern.
subtests in each file. To filter tests at subsequent levels, specify this option multiple times.
format pattern like a JavaScript RegExp literal. For example: '/xyz/i' for case-insensitive matching.
Invert the matches to --grep patterns. (Like grep -v)
Use colors (Default for TTY)
Do not use colors (Default for non-TTY)
Bail out on first failure
Do not bail out on first failure (Default)
Only run tests with {only: true} option
Use the specified reporter. Defaults to 'classic' when colors are in use, or 'tap' when colors are disabled.
classic doc dot dump json jsonstream landing list markdown min nyan progress silent spec tap xunit
Send the raw TAP output to the specified
file. Reporter output will still be printed to stdout, but the file will contain the raw TAP for later reply or analysis.
If <file> exists, then it should be a linedelimited list of test files to run. If <file> is not present, then all command-line positional arguments are run.
failed test files are written back to the save file.
re-run failures until all the failures are passing, and then once again run all tests.
used for this purpose, as it will churn a lot.
Capture coverage information using 'nyc'
variable is set, then coverage is captured by default and sent to the coveralls.io service.
Do not capture coverage information. Note that if nyc is already loaded, then the coverage info will still be captured.
Output coverage information using the specified istanbul/nyc reporter type.
command line, or 'text-lcov' when piping to coveralls.
be opened in a web browser after running.
after a test run that included coverage.
Do not output a coverage report.
Do not open a web browser after generating an html coverage report.
Time out test files after <n> seconds. Defaults to 30, or the value of the TAP_TIMEOUT environment variable. Setting to 0 allows tests to run forever.
Do not time out tests. Equivalent to --timeout=0
print this thing you're looking at
show the version of this program
Pass an argument to Node binary in all child processes. Run 'node --help' to see a list of all relevant arguments. This can be specified multiple times to pass multiple args to Node.
Expose the gc() function to Node tests
Run JavaScript tests with node --debug
Run JavaScript tests with node --debug-brk
Enable all Harmony flags in JavaScript tests
Run JS tests in 'use strict' mode
Pass an argument to test files spawned by the tap command line executable. This can be specified multiple times to pass multiple args to test scripts.
Pass an argument to nyc when running child processes with coverage enabled. This can be specified multiple times to pass multiple args to nyc.
Check whether coverage is within thresholds provided. Setting this explicitly will default --coverage to true.
after a test run that included coverage.
what % of branches must be covered? Setting this will default both --check-coverage and --coverage to true. [default: 0]
what % of functions must be covered? Setting this explicitly will default both --check-coverage and --coverage to true. [default: 0]
what % of lines must be covered? Setting this explicitly will default both --check-coverage and --coverage to true. [default: 90]
what % of statements must be covered? Setting this explicitly will default both --check-coverage and --coverage to true. [default: 0]
--100
Full coverage, 100%. Sets branches, statements, functions, and lines to 100.
Print nyc usage banner. Useful for viewing options for --nyc-arg.
Print version of nyc used by tap.
Dump the config options in JSON format.
--
Stop parsing flags, and treat any additional command line arguments as filenames.

Environment Variables:

Set to '1' to generate snapshot files for `t.matchSnapshot()` assertions.
A yaml formatted file which can set any of the above options. Defaults to $HOME/.taprc
Default value for --timeout option.
Set to '1' to force color output, or '0' to prevent color output.
Bail out on the first test failure. Used internally when '--bailout' is set.
Set to '1' to force standard TAP output, and suppress any reporters. Used when running child tests so that their output is parseable by the test harness.
Set to '1' to show diagnostics by default for passing tests. Set to '0' to NOT show diagnostics by default for failing tests. If not one of these two values, then diagnostics are printed by default for failing tests, and not for passing tests.
Set to '1' to run subtests in buffered mode by default.
Set to '1' to include node-tap internals in stack traces. By default, these are included only when the current working directory is the tap project itself. Note that node internals are always excluded.
Set to '1' to exclude node-tap internals in stack traces, even if the current working directory is the tap project itself.
_TAP_COVERAGE_
Reserved for internal use.
Set to '1' to turn on debug mode.
Include 'tap' to turn on debug mode.
A '\n'-delimited list of grep patterns to apply to root level test objects. (This is an implementation detail for how the '--grep' option works.)
Set to '1' to invert the meaning of the patterns in TAP_GREP. (Implementation detail for how the '--invert' flag works.)

Config Files:

You can create a yaml file with any of the options above. By default, the file at ~/.taprc will be loaded, but the TAP_RCFILE environment variable can modify this.

Run 'tap --dump-config' for a listing of what can be set in that file. Each of the keys corresponds to one of the options above.

August 2020 run.js 12.0.1