Skip to content

Commit

Permalink
doc: Update Readme for filter conditions in unit tests
Browse files Browse the repository at this point in the history
* Update Readme for filter conditions in unit tests

Document all possible filter conditions added in nodejs/node-addon-api#1078

PR-URL:nodejs/node-addon-api#1199
Reviewed-By: Michael Dawson <[email protected]>
  • Loading branch information
kevindavies8 committed Aug 19, 2022
1 parent 8b9b0c3 commit 7281331
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,28 @@ npm test --NAPI_VERSION=X

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

To run a specific unit test, filter conditions are available

**Example:**
compile and run only tests on objectwrap.cc and objectwrap.js
```
npm run unit --filter=objectwrap
```

Multiple unit tests cane be selected with wildcards

**Example:**
compile and run all test files ending with "reference" -> function_reference.cc, object_reference.cc, reference.cc
```
npm run unit --filter=*reference
```

Multiple filter conditions can be joined to broaden the test selection

**Example:**
compile and run all tests under folders threadsafe_function and typed_threadsafe_function and also the objectwrap.cc file
npm run unit --filter='*function objectwrap'

### **Debug**

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

0 comments on commit 7281331

Please sign in to comment.