Skip to content

v8.0.0

Compare
Choose a tag to compare
@berniegp berniegp released this 09 Aug 22:02

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.