From 5550637c63a7dfd31a16d8fce4c7123272428fcb Mon Sep 17 00:00:00 2001 From: Deepak Rajamohan Date: Fri, 19 Aug 2022 08:14:55 -0700 Subject: [PATCH] Update Readme for filter conditions in unit tests Document all possible filter conditions added in https://github.com/nodejs/node-addon-api/pull/1078 --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index ae2e7e1dc..cd25bd840 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 filters 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 tests files ending with reference -> function_reference.cc object_reference.cc reference.cc + ``` + npm run unit --filter=*reference + ``` + +Multiple filter conditions can be joined as well + +**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: