How does Jest’s callback testing actually work

Posted by Andre Scott | Updated on

A function has a .length property that returns the number of arguments that are declared for it:

That’s how Jest knows that your test handler expects a done callback, and it will assume the test is asynchronous.

If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@] Your question and answer will appear on and help other developers.

Related Questions & Answers