It ensures cleanup is always called, even when the user doesn't set a closed callback, by setting dummy callbacks (fix after the close process redesign in https://github.com/murat-dogan/node-datachannel/pull/239). You can check that Jest doesn't report open handles anymore for dc1 and peer2 in p2p.test.js after running tests.
This PR fixes two issues related to
ThreadSafeCallback
:dc1
andpeer2
inp2p.test.js
after running tests.