Skip to content

Releases: knee-cola/jest-mock-axios

3.1.0

29 Jul 18:16
e5d7aa1
Compare
Choose a tag to compare

Features

  • We switched the library for synchronous promises from jest-mock-promise to synchronous-promise. This offers us:
    • Support for finally (#35)
    • Better handling of .catch (#17)

(Breaking) Changes

  • You can no longer pass the return value of then and catch to lastPromiseGet. This was an undocumented feature. Use the promise directly instead.
  • The error object used for mockError is now passed directly to catch / reject instead of being cloned beforehand (#14)

3.0.0

27 Apr 19:35
4840ebc
Compare
Choose a tag to compare

Changes

  • Make interface methods non-optional in typings

Features

  • Allow specifying requests to respond to (#1) - see README
  • Provide mocked cancellation (#30, #32), thanks @VanTanev

2.4.0

08 Apr 19:05
96385d4
Compare
Choose a tag to compare

Features

  • Throw more descriptive error messages when trying to respond to no request as described in #3 (throwing an error can be disabled totally by passing a new, third argument silentMode to mockResponse and mockError)
  • Improve type definitions (#25)
  • Add support for setting default common headers (#16)

Docs

  • Improved docs (#26)

2.3.0

19 Mar 15:53
5d085e4
Compare
Choose a tag to compare

Features

  • Add basic support for interceptors (#5, #23)
  • Add support for more methods (patch, head, options) (#11, #12)
  • Add support for axios.all (#21)

Bugfixes

  • Fix typescript declarations (#10, #15)

Internals

  • Fix various README typos (#22)
  • Migrate internal build process from webpack to typescript (#10)