throwIfRequested
inCancelToken
now actually throws if requested (not surprising, so not "really" breaking)
- Added
getReqByMatchUrl
(!52) by @niltonvasques - Expose pending requests as
queue
(!52) by @niltonvasques
- Fixed some bugs regarding to the cancel implementation
- Support
axios(url, [config])
syntax
- Using
.cancel
in the code to test now actually cancels (i.e. rejects) the axios call / promise.
- The signatures of
get
,delete
,head
, andoptions
now align with these of axios, meaning that the third argument (used to bedata
) has been removed.
- Added
mockResponseFor
andgetReqMatching
to support more sophisticated request-responding (#43 by @ThiefMaster)
- Updated dependencies
- Update dependencies
- Fixes an upstream bug in
synchronous-promise
wherefinally
would be called too early (#38)
-
We switched the library for synchronous promises from
jest-mock-promise
tosynchronous-promise
. This offers us:- Support for
finally
(#35) - Better handling of
.catch
(#17)
- Support for
-
The error object used for
mockError
is now passed directly tocatch
/reject
instead of being cloned beforehand (#14) (Breaking)
- You can no longer pass the return value of
then
andcatch
tolastPromiseGet
. This was an undocumented feature. Use the promise directly instead.
- Allow specifying requests to respond to (#1) - see README
- Provide mocked cancellation (#30, #32), thanks @VanTanev
- Make interface methods non-optional in typings
- Add support for setting default common headers (#16)
- 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
tomockResponse
andmockError
) - Improve type definitions (#25)
- Improved docs (#26)
- Add basic support for interceptors (#5, #23)
- Add support for more methods (
patch
,head
,options
) (#11, #12) - Add support for
axios.all
(#21)
- Fix typescript declarations (#10, #15)
- Fix various README typos (#22)
- Migrate internal build process from webpack to typescript (#10)