Currently, I am working on writing a unit test to verify if an ajax call has been successfully made. The code snippet in question is quite straightforward:
it('test spycall',()=>{
spyOn($,"ajax");
//my method call which uses ajax internally
MyFunc();
expect($.ajax.calls.mostRecent().args[0]["url"].toEqual("myurl");
});
However, upon running the test, I encounter this error message:
The property 'calls' does not exist on the type '{settings:jqueryAjaxSettings):jQueryXHR;(url:string, settings?:JQueryAjaxSettings}