test: use WeakRef instead of weak-napi for GC tests + chore: add debugging configuration for VsCode #631
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This changes the GC tests to use the native WeakRef, which is easier to work with than weak-napi.
I dived deep into the reason why some of the GC tests were failing, and I realized the last GC finalizer test was not helpful as the Socket is not closed resulting in global sharing of the context, so no GC happens for that. The rest of the GC tests are passing now.
Fixes #466
Fixes #390
Related to #529
Closes #612 (squashed as the first commit)