MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / expectRequest

Function expectRequest

javascript/webdriver/test/http/xhrclient_test.js:65–71  ·  view source on GitHub ↗
(mockXhr)

Source from the content-addressed store, hash-verified

63}
64
65function expectRequest(mockXhr) {
66 mockXhr.open(REQUEST.method, URL + REQUEST.path, true);
67 for (var header in REQUEST.headers) {
68 mockXhr.setRequestHeader(header, REQUEST.headers[header]);
69 }
70 return mockXhr.send(JSON.stringify(REQUEST.data));
71}
72
73function testXhrClient_whenUnableToSendARequest() {
74 expectRequest(mockXhr).$does(function() {

Calls 2

openMethod · 0.80
sendMethod · 0.65

Tested by

no test coverage detected