I have a code that needs to be tested with Mocha. In a certain part of the code, this is included:
var deferred = $.Deferred();
And I am getting this error:
TypeError: $.Deferred is not a function
I tried to add jQuery to the Mocha tests, and that solved the issue of not knowing what $ was, but still getting an error when calling Deferred.
This is how I included jQuery for the tests:
global.$ = global.jQuery = require('jquery');