This repository was archived by the owner on May 20, 2025. It is now read-only.
Stubbing global objects' methods
- Add stubs to mock global objects methods
var $ = require('jquery'),
stubbed = this.generateStub($, "ajax"),
object = {
method: function() {
$.ajax("http://foo.bar");
}
};
this
.if(object.method())
.then()
.stub(stubbed).wasCalled().withArguments("http://foo.bar")
;
$.load.restore();- Stubbed methods are restored after each test
- Add Grunt Task
- Fix exit status code