Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,25 @@ You can also execute the tests in a test suite directory
tools/test.py test/message
```

You can execute tests that match a specific naming pattern using the wildcard
`*`. For example, to run all tests under `test/parallel` with a name that starts
with `test-stream-`:

```bash
tools/test.py test/parallel/test-stream-*
# In some shell environments, you may need to quote the pattern
tools/test.py "test/parallel/test-stream-*"
```

The whildcard `*` can be used in any part of the path. For example, to run all tests
with a name that starts with `test-inspector-`, regardless of the directory they are in:

```bash
# Matches test/sequential/test-inspector-*, test/parallel/test-inspector-*,
# test/known_issues/test-inspector-*, etc.
tools/test.py test/*/test-inspector-*
```

If you want to check the other options, please refer to the help by using
the `--help` option:

Expand Down
5 changes: 5 additions & 0 deletions doc/contributing/writing-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,11 @@ To generate a test coverage report, see the
Nightly coverage reports for the Node.js `main` branch are available at
<https://coverage.nodejs.org/>.

## Running tests

See the [Building guide](../../BUILDING.md#running-tests) for details on how to
run tests.

[ASCII]: https://man7.org/linux/man-pages/man7/ascii.7.html
[Google Test]: https://github.com/google/googletest
[Test Coverage section of the Building guide]: https://github.com/nodejs/node/blob/HEAD/BUILDING.md#running-coverage
Expand Down
Loading