From a4afd2861c17b08b8f11e930abb418bcf6a948db Mon Sep 17 00:00:00 2001 From: Fabian Meyer <3982806+meyfa@users.noreply.github.com> Date: Tue, 26 Mar 2024 10:00:45 +0100 Subject: [PATCH] doc: quote test_runner glob parameters Refs: https://github.com/nodejs/node/issues/52191 PR-URL: https://github.com/nodejs/node/pull/52201 Reviewed-By: Luigi Pinca Reviewed-By: Chemi Atlow Reviewed-By: Moshe Atlow --- doc/api/test.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/api/test.md b/doc/api/test.md index cb386825048362..2cceaf9d7208e4 100644 --- a/doc/api/test.md +++ b/doc/api/test.md @@ -350,7 +350,7 @@ The Node.js test runner can be invoked from the command line by passing the node --test ``` -By default Node.js will run all files matching these patterns: +By default, Node.js will run all files matching these patterns: * `**/*.test.?(c|m)js` * `**/*-test.?(c|m)js` @@ -362,9 +362,11 @@ By default Node.js will run all files matching these patterns: Alternatively, one or more glob patterns can be provided as the final argument(s) to the Node.js command, as shown below. Glob patterns follow the behavior of [`glob(7)`][]. +The glob patterns should be enclosed in double quotes on the command line to +prevent shell expansion, which can reduce portability across systems. ```bash -node --test **/*.test.js **/*.spec.js +node --test "**/*.test.js" "**/*.spec.js" ``` Matching files are executed as test files.