I see this example in Mockjax docs:
$.mockjax({
url: "/rest",
data: function ( json ) {
assert.deepEqual( JSON.parse(json), expected ); // QUnit example.
return true;
}
});
But I am not sure how should I use it with QUnit testing methods. Any ideas?
I tried this but it says it expected at least one assertion, as if it doesn't run it at all, the assert line:
QUnit.test("mockjax test", function (assert) {
$.mockjax({
url: "/restful/fortune",
data: function (json) {
assert.deepEqual(JSON.parse(json), expected); // QUnit example.
return true;
},
responseText: {
status: "success",
fortune: "Are you a mock turtle?"
}
});
});