Access to an instance with :
const mockAgent = new MockAgent({ enableCallHistory: true })
mockAgent.getCallHistory()?.firstCall()- body
mockAgent.getCallHistory()?.firstCall()?.body - headers
mockAgent.getCallHistory()?.firstCall()?.headersan object - method
mockAgent.getCallHistory()?.firstCall()?.methoda string - fullUrl
mockAgent.getCallHistory()?.firstCall()?.fullUrla string containing the protocol, origin, path, query and hash - origin
mockAgent.getCallHistory()?.firstCall()?.origina string containing the protocol and the host - headers
mockAgent.getCallHistory()?.firstCall()?.headersan object - path
mockAgent.getCallHistory()?.firstCall()?.patha string always starting with/ - searchParams
mockAgent.getCallHistory()?.firstCall()?.searchParamsan object - protocol
mockAgent.getCallHistory()?.firstCall()?.protocola string (https:) - host
mockAgent.getCallHistory()?.firstCall()?.hosta string - port
mockAgent.getCallHistory()?.firstCall()?.portan empty string or a string containing numbers - hash
mockAgent.getCallHistory()?.firstCall()?.hashan empty string or a string starting with#
Returns a Map instance
mockAgent.getCallHistory()?.firstCall()?.toMap()?.get('hash')
// #hashReturns a string computed with any class property name and value pair
mockAgent.getCallHistory()?.firstCall()?.toString()
// protocol->https:|host->localhost:4000|port->4000|origin->https://localhost:4000|path->/endpoint|hash->#here|searchParams->{"query":"value"}|fullUrl->https://localhost:4000/endpoint?query=value#here|method->PUT|body->"{ "data": "hello" }"|headers->{"content-type":"application/json"}