UNPKG

4.49 kBMarkdownView Raw
1# Changelog
2
3## [4.7.2] - 2023-05-06
4
5### Fixed
6
7- Fixed missing type exports (#97)
8
9## [4.7.1] - 2023-03-15
10
11### Added
12
13- `useRequestHandler` allows you to dynamically handle every invoked request (#95) - by @rubenduiveman (#95)
14
15## [4.6.3] - 2023-03-15
16
17### Added
18
19- `useRequestHandler` allows you to dynamically handle every invoked request (#95) - by @rubenduiveman (#95)
20
21## [4.7.0] (Beta 2) - 2022-11-12
22
23### Added
24
25- Added (empty) default objects for configuration per HTTP verb (#88) - by @CezarManea (#89)
26
27### Other
28
29- Bumped dependencies (Jest 29)
30
31## [4.7.0] (Beta 1) - 2022-09-01
32
33### Fixed
34
35- Using `Promise.reject` in interceptors triggers `UnhandledPromiseRejection` (#87)
36
37### Changed
38
39- Calling `MockAxios.reset()` now resets interceptors as well
40
41### Other
42
43- Updated dependencies (Jest 28)
44
45## [4.6.2] - 2022-11-12
46
47### Added
48
49- Added (empty) default objects for configuration per HTTP verb (#88) - by @CezarManea (#89)
50
51## [4.6.1] - 2022-04-13
52
53### Changed
54
55- Revert "Experimental support for native ESM" (#83)
56
57## [4.6.0] - 2022-04-13
58
59### Changed
60
61- Experimental support for native ESM (#79)
62
63### Added
64
65- Interceptors are applied now (#82 by @yarilchenko)
66
67## [4.5.0] - 2021-12-05
68
69### Added
70
71- Added support for passing `params` in `getReqMatching` (with support from @kylorhall, #77)
72
73## [4.4.1] - 2021-09-28
74
75### Other
76
77- Updated dependencies (Jest 27)
78
79## [4.4.0] - 2021-04-18
80
81### Added
82
83- Added `getReqByRegex` by @Victorcorcos
84
85### Other
86
87- Updated dependencies
88
89## [4.3.0] - 2021-02-05
90
91### Added
92
93- Added mock for `isAxiosError` by @mAAdhaTTah (#66)
94- Errors passed to `mockError` wil now have `isAxiosError` attached by @mAAdhaTTah (#66)
95
96### Other
97
98- Updated dependencies
99
100## [4.2.1] - 2020-07-21
101
102### Fixed
103
104- Add mock for `interceptors.eject` by @webbushka
105
106### Changed
107
108- Ignore case when matching HTTP methods by @Chris-Thompson-bnsf
109
110## [4.2.0] - 2020-06-04
111
112### Breaking
113
114- `throwIfRequested` in `CancelToken` now actually throws if requested (not surprising, so not "really" breaking)
115
116### Added
117
118- Added `getReqByMatchUrl` (!52) by @niltonvasques
119- Expose pending requests as `queue` (!52) by @niltonvasques
120
121### Fixed
122
123- Fixed some bugs regarding to the cancel implementation
124
125## [4.1.0] - 2020-05-22
126
127### Added
128
129- Support `axios(url, [config])` syntax
130
131## [4.0.0] - 2020-04-28
132
133### Changed
134
135- Using `.cancel` in the code to test now actually cancels (i.e. rejects) the axios call / promise.
136
137### Removed
138
139- The signatures of `get`, `delete`, `head`, and `options` now align with these of axios, meaning that the third argument (used to be `data`) has been removed.
140
141## [3.2.0] - 2019-12-08
142
143### Added
144
145- Added `mockResponseFor` and `getReqMatching` to support more sophisticated request-responding (#43 by @ThiefMaster)
146
147### Other
148
149- Updated dependencies
150
151## [3.1.2] - 2019-10-26
152
153### Other
154
155- Update dependencies
156
157## [3.1.1] - 2019-09-07
158
159### Fixed
160
161- Fixes an upstream bug in `synchronous-promise` where `finally` would be called too early (#38)
162
163## [3.1.0] - 2019-07-29
164
165### Changed
166
167- We switched the library for synchronous promises from `jest-mock-promise` to `synchronous-promise`. This offers us:
168 - Support for `finally` (#35)
169 - Better handling of `.catch` (#17)
170
171- The error object used for `mockError` is now passed directly to `catch` / `reject` instead of being cloned beforehand (#14) (Breaking)
172
173
174### Removed
175
176- You can no longer pass the return value of `then` and `catch` to `lastPromiseGet`. This was an undocumented feature. Use the promise directly instead.
177
178## [3.0.0] - 2019-04-27
179
180### Added
181
182* Allow specifying requests to respond to (#1) - see README
183* Provide mocked cancellation (#30, #32), thanks @VanTanev
184
185### Changed
186
187* Make interface methods non-optional in typings
188
189
190## [2.4.0] - 2019-04-08
191
192### Added
193
194- Add support for setting default common headers (#16)
195
196### Changed
197
198- 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`)
199- Improve type definitions (#25)
200
201### Docs
202
203- Improved docs (#26)
204
205## [2.3.0] - 2019-03-19
206
207### Added
208- Add basic support for interceptors (#5, #23)
209- Add support for more methods (`patch`, `head`, `options`) (#11, #12)
210- Add support for `axios.all` (#21)
211
212### Fixed
213- Fix typescript declarations (#10, #15)
214
215### Other
216- Fix various README typos (#22)
217- Migrate internal build process from webpack to typescript (#10)