Skip to content

Releases: berniegp/mock-xmlhttprequest

v8.3.0

24 Nov 21:13
Compare
Choose a tag to compare

New features

  • Dropped support for Node.js 14 and add tests for Node.js 20+
  • Updated to TypeScript 5.2
  • Updated devDependencies
  • Fixed missing changes to apply the MIT license
  • Fixed a TypeScript "full" import used instead of a type-only import

v8.2.0

12 Apr 22:04
Compare
Choose a tag to compare

New features

  • Update the license to MIT
  • Make all MockXhrServer functions chainable
  • Add MockXhr argument to the onSend hook
  • Updated devDependencies

v8.1.0

03 Sep 21:55
Compare
Choose a tag to compare

New features

  • Update to XMLHttpRequest version "15 August 2022".
  • Added support for automatic progress events in MockXhrServer via the progressRate field.
  • The MockXhrServer now automatically sets the Content-Length response header for object request handlers.
  • setResponseBody() now automatically sets the Content-Length response header if setResponseHeaders() was not called.

Bug fixes

  • Added missing validation in open() that throws an exception if the method argument is not a method.
  • Distinguish between when the async argument is omitted and when it's undefined in open().
  • On a readystatechange event, the listener list was not cloned prior to calling the event listeners.
  • Added missing header name and value validation in setRequestHeader().
  • Added the Content-Type request header when the request body is a FormData.
  • Don't discard empty header values given to setRequestHeader().

v8.0.1

02 Sep 19:31
Compare
Choose a tag to compare

New features

  • Added more descriptive error messages.

Bug fixes

  • Fixed TypeScript declaration of MockXhrServer (#38)

v8.0.0

09 Aug 22:02
Compare
Choose a tag to compare

Breaking changes

  • Added the MockXhrRequest class to isolate each call to send() and respond to requests (#30).
  • Added Node.js package entry points. This is the exports field of package.json.
  • Changed the call order of callbacks when multiple callbacks exist for the same lifecycle hook.
  • setRequestTimeout() now throws if timeout === 0.
  • MockXhrServer.getRequestLog() now returns an array copy.
  • MockXhr.requestHeaders now returns a copy of the request headers.
  • Several properties of classes that were meant to be read-only are now protected by getters.
  • Deprecated MockXhrServer.xhrMock. Use MockXhrServer.MockXhr instead.

New features

  • Documentation overhaul.
  • Migrated to TypeScript.
    • More accurate typings.
    • Type safety caught a few bugs.
  • Added 'timeout' and 'error' as declarative request handlers for the MockXhrServer.
  • Use Promise.resolve() instead of setTimeout() to call the onSend hook (#29).
  • Added MockXhr.getResponseHeadersHash().
  • Removed noop setters from readOnly attributes.
  • Updated devDependencies.

Bug fixes

  • Fixed incorrect usage of Blob when calculating the request's body size (#31).
  • Fixed bug where event handler properties (e.g. onload) were not called in the right order.
  • Fixed bug where event listener object callbacks did not receive the event as an argument.
  • Fixed bug where an event listener was called despite being removed by a previous event listener for the same event.

v7.0.4

09 May 14:36
Compare
Choose a tag to compare

New features

  • Update devDependencies

v7.0.3

25 Dec 16:56
Compare
Choose a tag to compare

New features

  • Update devDependencies

Bug fixes

  • Add MockXhr and xhrFactory fields to the MockXhrServer TypeScript definitions

v7.0.2

12 Dec 16:43
Compare
Choose a tag to compare

New features

  • Update devDependencies

Bug fixes

  • Add missing optional qualifiers in type declarations

v7.0.1

10 Oct 10:41
Compare
Choose a tag to compare

New features

  • Update dependencies

v7.0.0

31 Aug 12:14
Compare
Choose a tag to compare

New features

  • Sort headers as if ASCII-uppercased in getAllResponseHeaders()
  • Validate changes to the XMLHttpRequest spec up to version "18 August 2020"