Skip to content

Commit e9def3e

Browse files
authored
doc: Update Readme for filter conditions in unit tests
* Update Readme for filter conditions in unit tests Document all possible filter conditions added in #1078 PR-URL:#1199 Reviewed-By: Michael Dawson <[email protected]>
1 parent efd6787 commit e9def3e

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,28 @@ npm test --NAPI_VERSION=X
187187

188188
where X is the version of Node-API you want to target.
189189

190+
To run a specific unit test, filter conditions are available
191+
192+
**Example:**
193+
compile and run only tests on objectwrap.cc and objectwrap.js
194+
```
195+
npm run unit --filter=objectwrap
196+
```
197+
198+
Multiple unit tests cane be selected with wildcards
199+
200+
**Example:**
201+
compile and run all test files ending with "reference" -> function_reference.cc, object_reference.cc, reference.cc
202+
```
203+
npm run unit --filter=*reference
204+
```
205+
206+
Multiple filter conditions can be joined to broaden the test selection
207+
208+
**Example:**
209+
compile and run all tests under folders threadsafe_function and typed_threadsafe_function and also the objectwrap.cc file
210+
npm run unit --filter='*function objectwrap'
211+
190212
### **Debug**
191213

192214
To run the **node-addon-api** tests with `--debug` option:

0 commit comments

Comments
 (0)