I’d like to replace some functions inside of test environment to make sure that they’re only called inside test with done
callback available. This is to catch (for example) cases where setTimeout
is used in a test which does not wait for completion. I’m trying to achieve something like UnhandledPromiseRejection
here, but for timers.
But the part I can’t figure out is: How would I check if the test I’m currently running is using the done
callback or not? (in a function down the stack, not in the test itself)