How to use the fake-xml-http-request.UNSENT function in fake-xml-http-request

To help you get started, we’ve selected a few fake-xml-http-request examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github folio-org / stripes-core / test / bigtest / network / patch-fake-xml-http-request.js View on Github external
FakeXMLHttpRequest.prototype.abort = function() {
  this.aborted = true;
  this.responseText = null;
  delete this.response;
  this.errorFlag = true;
  this.requestHeaders = {};

  this.dispatchEvent(new _Event("abort", false, false, this));

  if (this.readyState > FakeXMLHttpRequest.UNSENT && this.sendFlag) {
    this._readyStateChange(FakeXMLHttpRequest.UNSENT);
    this.sendFlag = false;
  }

  if (typeof this.onerror === "function") {
    this.onerror();
  }
}
github folio-org / stripes-core / test / bigtest / network / patch-fake-xml-http-request.js View on Github external
FakeXMLHttpRequest.prototype.abort = function() {
  this.aborted = true;
  this.responseText = null;
  delete this.response;
  this.errorFlag = true;
  this.requestHeaders = {};

  this.dispatchEvent(new _Event("abort", false, false, this));

  if (this.readyState > FakeXMLHttpRequest.UNSENT && this.sendFlag) {
    this._readyStateChange(FakeXMLHttpRequest.UNSENT);
    this.sendFlag = false;
  }

  if (typeof this.onerror === "function") {
    this.onerror();
  }
}

fake-xml-http-request

test infrastructure for a fake XMLHttpRequest object

MIT
Latest version published 4 years ago

Package Health Score

59 / 100
Full package analysis