.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6. .TH RUN.JS "1" "September 2018" "run.js 12.0.1" "User Commands" .SH NAME run.js \- Test-Anything-Protocol module for Node.js .SH DESCRIPTION .SS "Usage:" .IP tap [options] .PP Executes all the files and interprets their output as TAP formatted test result data. .PP To parse TAP data from stdin, specify "\-" as a filename. .PP Short options are parsed gnu\-style, so for example '\-bCRspec' would be equivalent to '\-\-bail \fB\-\-no\-color\fR \fB\-\-reporter\fR=\fI\,spec\/\fR' .PP If the \fB\-\-check\-coverage\fR or \fB\-\-coverage\-report\fR 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. .PP Coverage is never enabled for stdin. .SH OPTIONS .TP \fB\-j\fR \fB\-\-jobs=\fR Run up to 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. .TP \fB\-J\fR \fB\-\-jobs\-auto\fR 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. .TP \fB\-g\fR Only run subtests tests matching the specified .TP \fB\-\-grep=\fR pattern. .TP Patterns are matched against top\-level subtests in each file. To filter tests at subsequent levels, specify this option multiple times. .TP To specify regular expression flags, format pattern like a JavaScript RegExp literal. For example: '/xyz/i' for case\-insensitive matching. .TP \fB\-i\fR \fB\-\-invert\fR Invert the matches to \fB\-\-grep\fR patterns. (Like grep \fB\-v\fR) .TP \fB\-c\fR \fB\-\-color\fR Use colors (Default for TTY) .TP \fB\-C\fR \fB\-\-no\-color\fR Do not use colors (Default for non\-TTY) .TP \fB\-b\fR \fB\-\-bail\fR Bail out on first failure .TP \fB\-B\fR \fB\-\-no\-bail\fR Do not bail out on first failure (Default) .TP \fB\-O\fR \fB\-\-only\fR Only run tests with {only: true} option .TP \fB\-R\fR \fB\-\-reporter=\fR Use the specified reporter. Defaults to \&'classic' when colors are in use, or 'tap' when colors are disabled. .TP Available reporters: classic doc dot dump json jsonstream landing list markdown min nyan progress silent spec tap xunit .TP \fB\-o\fR Send the raw TAP output to the specified .TP \fB\-\-output\-file=\fR file. Reporter output will still be printed to stdout, but the file will contain the raw TAP for later reply or analysis. .TP \fB\-s\fR \fB\-\-save=\fR If exists, then it should be a linedelimited list of test files to run. If is not present, then all command\-line positional arguments are run. .TP After the set of test files are run, any failed test files are written back to the save file. .TP This way, repeated runs with \fB\-s\fR will re\-run failures until all the failures are passing, and then once again run all tests. .TP It's a good idea to .gitignore the file used for this purpose, as it will churn a lot. .TP \fB\-\-coverage\fR \fB\-\-cov\fR Capture coverage information using 'nyc' .TP If a COVERALLS_REPO_TOKEN environment variable is set, then coverage is captured by default and sent to the coveralls.io service. .TP \fB\-\-no\-coverage\fR \fB\-\-no\-cov\fR Do not capture coverage information. Note that if nyc is already loaded, then the coverage info will still be captured. .TP \fB\-\-coverage\-report=\fR Output coverage information using the specified istanbul/nyc reporter type. .TP Default is 'text' when running on the command line, or 'text\-lcov' when piping to coveralls. .TP If 'html' is used, then the report will be opened in a web browser after running. .TP This can be run on its own at any time after a test run that included coverage. .TP \fB\-\-no\-coverage\-report\fR Do not output a coverage report. .TP \fB\-\-no\-browser\fR Do not open a web browser after generating an html coverage report. .TP \fB\-t\fR \fB\-\-timeout=\fR Time out test files after seconds. Defaults to 30, or the value of the TAP_TIMEOUT environment variable. Setting to 0 allows tests to run forever. .TP \fB\-T\fR \fB\-\-no\-timeout\fR Do not time out tests. Equivalent to \fB\-\-timeout\fR=\fI\,0\/\fR .TP \fB\-h\fR \fB\-\-help\fR print this thing you're looking at .TP \fB\-v\fR \fB\-\-version\fR show the version of this program .TP \fB\-\-node\-arg=\fR Pass an argument to Node binary in all child processes. Run 'node \fB\-\-help\fR' to see a list of all relevant arguments. This can be specified multiple times to pass multiple args to Node. .TP \fB\-gc\fR \fB\-\-expose\-gc\fR Expose the gc() function to Node tests .TP \fB\-\-debug\fR Run JavaScript tests with node \fB\-\-debug\fR .TP \fB\-\-debug\-brk\fR Run JavaScript tests with node \fB\-\-debug\-brk\fR .TP \fB\-\-harmony\fR Enable all Harmony flags in JavaScript tests .TP \fB\-\-strict\fR Run JS tests in 'use strict' mode .TP \fB\-\-test\-arg=\fR 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. .TP \fB\-\-nyc\-arg=\fR Pass an argument to nyc when running child processes with coverage enabled. This can be specified multiple times to pass multiple args to nyc. .TP \fB\-\-check\-coverage\fR Check whether coverage is within thresholds provided. Setting this explicitly will default \fB\-\-coverage\fR to true. .TP This can be run on its own any time after a test run that included coverage. .TP \fB\-\-branches\fR what % of branches must be covered? Setting this will default both \fB\-\-check\-coverage\fR and \fB\-\-coverage\fR to true. [default: 0] .TP \fB\-\-functions\fR what % of functions must be covered? Setting this explicitly will default both \fB\-\-check\-coverage\fR and \fB\-\-coverage\fR to true. [default: 0] .TP \fB\-\-lines\fR what % of lines must be covered? Setting this explicitly will default both \fB\-\-check\-coverage\fR and \fB\-\-coverage\fR to true. [default: 90] .TP \fB\-\-statements\fR what % of statements must be covered? Setting this explicitly will default both \fB\-\-check\-coverage\fR and \fB\-\-coverage\fR to true. [default: 0] .TP \fB\-\-100\fR Full coverage, 100%. Sets branches, statements, functions, and lines to 100. .TP \fB\-\-nyc\-help\fR Print nyc usage banner. Useful for viewing options for \fB\-\-nyc\-arg\fR. .TP \fB\-\-nyc\-version\fR Print version of nyc used by tap. .TP \fB\-\-dump\-config\fR Dump the config options in JSON format. .TP \fB\-\-\fR Stop parsing flags, and treat any additional command line arguments as filenames. .PP Environment Variables: .TP TAP_SNAPSHOT Set to '1' to generate snapshot files for `t.matchSnapshot()` assertions. .TP TAP_RCFILE A yaml formatted file which can set any of the above options. Defaults to $HOME/.taprc .TP TAP_TIMEOUT Default value for \fB\-\-timeout\fR option. .TP TAP_COLORS Set to '1' to force color output, or '0' to prevent color output. .TP TAP_BAIL Bail out on the first test failure. Used internally when '\-\-bailout' is set. .TP TAP 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. .TP TAP_DIAG 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. .TP TAP_BUFFER Set to '1' to run subtests in buffered mode by default. .TP TAP_DEV_LONGSTACK 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. .TP TAP_DEV_SHORTSTACK Set to '1' to exclude node\-tap internals in stack traces, even if the current working directory is the tap project itself. .TP _TAP_COVERAGE_ Reserved for internal use. .TP TAP_DEBUG Set to '1' to turn on debug mode. .TP NODE_DEBUG Include 'tap' to turn on debug mode. .TP TAP_GREP A '\en'\-delimited list of grep patterns to apply to root level test objects. (This is an implementation detail for how the '\-\-grep' option works.) .TP TAP_GREP_INVERT Set to '1' to invert the meaning of the patterns in TAP_GREP. (Implementation detail for how the '\-\-invert' flag works.) .PP Config Files: .PP 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. .PP Run 'tap \fB\-\-dump\-config\fR' for a listing of what can be set in that file. Each of the keys corresponds to one of the options above.