From 728133107d984c719e146bd2cf92e12b49700f9b Mon Sep 17 00:00:00 2001 From: Kenvin Davies Date: Fri, 19 Aug 2022 11:17:36 -0700 Subject: [PATCH] doc: Update Readme for filter conditions in unit tests * Update Readme for filter conditions in unit tests Document all possible filter conditions added in https://github.com/nodejs/node-addon-api/pull/1078 PR-URL:https://github.com/nodejs/node-addon-api/pull/1199 Reviewed-By: Michael Dawson --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index ae2e7e1..1ad3792 100644 --- a/README.md +++ b/README.md @@ -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: