- Matching params now considers (almost all cases of) deep equality (#102)
- Dependency updates (#98, #99)
- Fixed missing type exports (#97)
useRequestHandler
allows you to dynamically handle every invoked request (#95) - by @rubenduiveman (#95)
useRequestHandler
allows you to dynamically handle every invoked request (#95) - by @rubenduiveman (#95)
- Added (empty) default objects for configuration per HTTP verb (#88) - by @CezarManea (#89)
- Bumped dependencies (Jest 29)
- Using
Promise.reject
in interceptors triggersUnhandledPromiseRejection
(#87)
- Calling
MockAxios.reset()
now resets interceptors as well
- Updated dependencies (Jest 28)
- Added (empty) default objects for configuration per HTTP verb (#88) - by @CezarManea (#89)
- Revert "Experimental support for native ESM" (#83)
- Experimental support for native ESM (#79)
- Interceptors are applied now (#82 by @yarilchenko)
- Added support for passing
params
ingetReqMatching
(with support from @kylorhall, #77)
- Updated dependencies (Jest 27)
- Added
getReqByRegex
by @Victorcorcos
- Updated dependencies
- Added mock for
isAxiosError
by @mAAdhaTTah (#66) - Errors passed to
mockError
wil now haveisAxiosError
attached by @mAAdhaTTah (#66)
- Updated dependencies
- Add mock for
interceptors.eject
by @webbushka
- Ignore case when matching HTTP methods by @Chris-Thompson-bnsf
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)