node-addon-api
node-addon-api copied to clipboard
test: Add test coverage to TSFN::New() overloads
Adding test coverage for TSFN::New
overloads where we provide the async resource name and/or the async resource object but no finalizer callbacks.
Hi @JckXia ,
I took a look at this and have a few questions:
- This tests
TypedThreadSafeFunction
, do we have equivalent coverage for the non-typedThreadSafeFunction
...? - I looked at all the
TypedTSFN::New
tests (including this PR) and I don't see these three... Maybe I overlooked them...?
Hey @KevinEady,
For your first question, not at the moment. My plan was to complete coverage for TypedThreadSafeFunction
and port some of these tests over late.
For your second question, I think I may have missed them and have also made a mistake in the test coverage doc for TSFN::New
. Will update accordingly.
Edit: I think
[Callback [missing] Resource [passed] Finalizer [passed]]
is covered here https://github.com/nodejs/node-addon-api/blob/main/test/typed_threadsafe_function/typed_threadsafe_function_ctx.cc#L49.