UNPKG

12.7 kBMarkdownView Raw
1# Changelog
2
3## [12.3.0](https://github.com/wheresrhys/fetch-mock/compare/fetch-mock-v12.2.1...fetch-mock-v12.3.0) (2025-02-04)
4
5
6### Features
7
8* added overwriteRoutes: true rule to codemods ([b3d1468](https://github.com/wheresrhys/fetch-mock/commit/b3d1468f93fb1bf18b5d3bf8c0a21dd56ad4d0aa))
9* implemented modifyRoute() method ([f62e3d6](https://github.com/wheresrhys/fetch-mock/commit/f62e3d6f9cf36d4bcb282089b63b0b5a5ee0c21c))
10* implemented removeRoute method ([584a861](https://github.com/wheresrhys/fetch-mock/commit/584a8619cae2e8ae513d2edc784dc7bbe13aa614))
11
12
13### Bug Fixes
14
15* make types for modify route config more accurate ([6894569](https://github.com/wheresrhys/fetch-mock/commit/689456923ea902c820688cbb9010b25ecf1387a1))
16* prevented overwriting stickiness of a route ([87f8c9b](https://github.com/wheresrhys/fetch-mock/commit/87f8c9beaf66e07bfc145b1a4069f157f535a248))
17
18## [12.2.1](https://github.com/wheresrhys/fetch-mock/compare/fetch-mock-v12.2.0...fetch-mock-v12.2.1) (2025-01-28)
19
20
21### Bug Fixes
22
23* fix failure to spy in browsers ([bfaa5f3](https://github.com/wheresrhys/fetch-mock/commit/bfaa5f33c133af17a0bd097d2d3dbcb01966a0a8))
24
25## [12.2.0](https://github.com/wheresrhys/fetch-mock/compare/fetch-mock-v12.1.0...fetch-mock-v12.2.0) (2024-11-15)
26
27
28### Features
29
30* implement new hardReset method ([d7e0776](https://github.com/wheresrhys/fetch-mock/commit/d7e0776ea54011bcccaee1e1edfb986e9f1a4397))
31* update codemods to use hardReset() ([757d480](https://github.com/wheresrhys/fetch-mock/commit/757d480532cfa8054471dec1bfcd89688966e37b))
32
33## [12.1.0](https://github.com/wheresrhys/fetch-mock/compare/fetch-mock-v12.0.3...fetch-mock-v12.1.0) (2024-11-08)
34
35
36### Features
37
38* **fetch-mock:** add include: matcher for urls ([02f880c](https://github.com/wheresrhys/fetch-mock/commit/02f880c64f96559efbccee6ba6d7ca4288efd92a))
39
40## [12.0.3](https://github.com/wheresrhys/fetch-mock/compare/fetch-mock-v12.0.2...fetch-mock-v12.0.3) (2024-11-08)
41
42
43### Bug Fixes
44
45* allow matching relative URLs ([2cba1bc](https://github.com/wheresrhys/fetch-mock/commit/2cba1bc0fdf6a042a715b2cb329ba5f369a71a5e))
46
47## [12.0.2](https://github.com/wheresrhys/fetch-mock/compare/fetch-mock-v12.0.1...fetch-mock-v12.0.2) (2024-10-28)
48
49
50### Bug Fixes
51
52* allow sending responses with status 0 ([92c06e9](https://github.com/wheresrhys/fetch-mock/commit/92c06e933fc8bd2e6b1027d1640d657bcf9a49a9))
53
54## [12.0.1](https://github.com/wheresrhys/fetch-mock/compare/fetch-mock-v12.0.0...fetch-mock-v12.0.1) (2024-10-27)
55
56
57### Bug Fixes
58
59* clearHistory() can deal with unmatched calls ([012e9ca](https://github.com/wheresrhys/fetch-mock/commit/012e9ca7d03e39e6832f9f40087ec53d6ccc2728))
60
61## [12.0.0](https://github.com/wheresrhys/fetch-mock/compare/fetch-mock-v11.1.5...fetch-mock-v12.0.0) (2024-10-24)
62
63
64### ⚠ BREAKING CHANGES
65
66* Replaced legacy fetch-mock code with fetch-mock/core code
67
68### Features
69
70* Replaced legacy fetch-mock code with fetch-mock/core code ([999ce92](https://github.com/wheresrhys/fetch-mock/commit/999ce9257de6683830c8e70dcda3862c3d13699e))
71
72## [0.7.1](https://github.com/wheresrhys/fetch-mock/compare/core-v0.7.0...core-v0.7.1) (2024-09-25)
73
74
75### Bug Fixes
76
77* change export order so default is last ([bc9c41d](https://github.com/wheresrhys/fetch-mock/commit/bc9c41d04609c40e609e672254df5ff1ddf0cad9))
78
79## [0.7.0](https://github.com/wheresrhys/fetch-mock/compare/core-v0.6.3...core-v0.7.0) (2024-08-30)
80
81
82### ⚠ BREAKING CHANGES
83
84* remove sendAsJson option
85
86### Features
87
88* remove sendAsJson option ([4b11fc4](https://github.com/wheresrhys/fetch-mock/commit/4b11fc4a5c92c81de8f89b1993a57c2645805ddb))
89* send content=length header whenever calculable ([ef4c684](https://github.com/wheresrhys/fetch-mock/commit/ef4c684bddb617e95c54217c86b6953637f21f74))
90
91
92### Bug Fixes
93
94* force engine to be >=18.11.0 as this fixes an issue in proxying a response ([dde5e6b](https://github.com/wheresrhys/fetch-mock/commit/dde5e6beb9aee103296cf060a9f027bffb4818e9))
95* handle all types of BodyInit correctly ([0242ea2](https://github.com/wheresrhys/fetch-mock/commit/0242ea2d6c30e36418f21a37a962fe1cf84c9271))
96
97## [0.6.3](https://github.com/wheresrhys/fetch-mock/compare/core-v0.6.2...core-v0.6.3) (2024-08-29)
98
99
100### Documentation Changes
101
102* minor corrections ([d77978a](https://github.com/wheresrhys/fetch-mock/commit/d77978a17825f166f06cbb1bbb911e7fb8790a4a))
103* readme for @fetch-mock/core ([5fd7c5a](https://github.com/wheresrhys/fetch-mock/commit/5fd7c5a1d37e546ab8dd6e173761ae0b8fb43878))
104* wrote a README for @fetch-mock/vitest ([d2d1ea3](https://github.com/wheresrhys/fetch-mock/commit/d2d1ea3f14012772edeb77a543384b99b3475e16))
105
106## [0.6.2](https://github.com/wheresrhys/fetch-mock/compare/core-v0.6.1...core-v0.6.2) (2024-08-28)
107
108
109### Bug Fixes
110
111* add missing metadata to package.json files ([4ab78b9](https://github.com/wheresrhys/fetch-mock/commit/4ab78b9429a376230da2ce57bd320031c53f06ef))
112
113## [0.6.1](https://github.com/wheresrhys/fetch-mock/compare/core-v0.6.0...core-v0.6.1) (2024-08-15)
114
115
116### Features
117
118* export more types from @fetch-mock/core ([2bff326](https://github.com/wheresrhys/fetch-mock/commit/2bff326063a362ea4ce0adc1102130bd1c31ac9e))
119
120## [0.6.0](https://github.com/wheresrhys/fetch-mock/compare/core-v0.5.0...core-v0.6.0) (2024-08-13)
121
122
123### ⚠ BREAKING CHANGES
124
125* force a major release due to breaking nature of relative url API changes
126
127### Features
128
129* implemented allowRelativeUrls option ([f32bd6e](https://github.com/wheresrhys/fetch-mock/commit/f32bd6e6ba7aed03ec0fd0c7361097e85c84224a))
130
131
132### Bug Fixes
133
134* all relative url behaviour is as expected now; ([dc99eb7](https://github.com/wheresrhys/fetch-mock/commit/dc99eb783e64c8c101c9d15fc59cccc7f7ad174d))
135* force a major release due to breaking nature of relative url API changes ([6f29db8](https://github.com/wheresrhys/fetch-mock/commit/6f29db8ff79a8c7a50ad03f4c1547d8716ffb298))
136
137## [0.5.0](https://github.com/wheresrhys/fetch-mock/compare/core-v0.4.12...core-v0.5.0) (2024-08-13)
138
139
140### ⚠ BREAKING CHANGES
141
142* implemented desired behaviour for dot path matching
143* implemented desired behaviour for protocol relative urls
144
145### Features
146
147* implemented desired behaviour for dot path matching ([b2fe6f8](https://github.com/wheresrhys/fetch-mock/commit/b2fe6f894b337ed213f55fed47f611acbdecd84f))
148* implemented desired behaviour for protocol relative urls ([06e6260](https://github.com/wheresrhys/fetch-mock/commit/06e62607dbfc7b71936b8a691e37ef9275e7cc11))
149
150## [0.4.12](https://github.com/wheresrhys/fetch-mock/compare/core-v0.4.11...core-v0.4.12) (2024-08-13)
151
152
153### Bug Fixes
154
155* roll back to glob-to-regexp ([b114124](https://github.com/wheresrhys/fetch-mock/commit/b11412452ed376ab2e20e03a51f0dc1de1dcdb90))
156
157## [0.4.11](https://github.com/wheresrhys/fetch-mock/compare/core-v0.4.10...core-v0.4.11) (2024-08-09)
158
159
160### Bug Fixes
161
162* force release of core ([6bf9b87](https://github.com/wheresrhys/fetch-mock/commit/6bf9b87f0598cb5a142d623c6285b0dca6c619d5))
163
164## [0.4.10](https://github.com/wheresrhys/fetch-mock/compare/core-v0.4.9...core-v0.4.10) (2024-08-08)
165
166
167### Bug Fixes
168
169* fix core package build ([90bbe76](https://github.com/wheresrhys/fetch-mock/commit/90bbe76ab384ec5cefeb17f19ca06ca386cbbde5))
170
171## [0.4.9](https://github.com/wheresrhys/fetch-mock/compare/core-v0.4.8...core-v0.4.9) (2024-08-08)
172
173
174### Bug Fixes
175
176* add license file to each package ([9b36f89](https://github.com/wheresrhys/fetch-mock/commit/9b36f892ed19cd381b1f8ebbd94a28773637b9ec))
177
178## [0.4.8](https://github.com/wheresrhys/fetch-mock/compare/core-v0.4.7...core-v0.4.8) (2024-08-03)
179
180
181### Documentation Changes
182
183* document and test behaviour with multiple missing headers ([88d0440](https://github.com/wheresrhys/fetch-mock/commit/88d0440b814a0f3309f49c30d6c81d899ebc65a6))
184
185## [0.4.7](https://github.com/wheresrhys/fetch-mock/compare/core-v0.4.6...core-v0.4.7) (2024-08-02)
186
187
188### Bug Fixes
189
190* correct types so that global optiosn can be passed in to route ([13e1fc6](https://github.com/wheresrhys/fetch-mock/commit/13e1fc64ca3a36f54765d588dc61d44cc92cd413))
191
192## [0.4.6](https://github.com/wheresrhys/fetch-mock/compare/core-v0.4.5...core-v0.4.6) (2024-07-30)
193
194
195### Bug Fixes
196
197* now more spec compliant on exceptions ([ceec07f](https://github.com/wheresrhys/fetch-mock/commit/ceec07f1c8c1be86111b4feaaab76c103885da4d))
198
199## [0.4.5](https://github.com/wheresrhys/fetch-mock/compare/core-v0.4.4...core-v0.4.5) (2024-07-26)
200
201
202### Features
203
204* allow spying on just one route ([a9638fc](https://github.com/wheresrhys/fetch-mock/commit/a9638fc12f60bfa28e6169a9fa736e2bbdc21a8a))
205* rename restoreGlobal to unmockGlobal ([3ad4241](https://github.com/wheresrhys/fetch-mock/commit/3ad4241f409353ac970cf26b1252b32ea6390208))
206
207## [0.4.4](https://github.com/wheresrhys/fetch-mock/compare/core-v0.4.3...core-v0.4.4) (2024-07-25)
208
209
210### Features
211
212* cancel readable streams as effectively as possible ([aa3b899](https://github.com/wheresrhys/fetch-mock/commit/aa3b89989bd223e788db895b03c4fabc56f061d2))
213* support multiple url matchers at once ([c83d9f9](https://github.com/wheresrhys/fetch-mock/commit/c83d9f992337eb6ff79f027a7fc2e6316ce36456))
214
215## [0.4.3](https://github.com/wheresrhys/fetch-mock/compare/core-v0.4.2...core-v0.4.3) (2024-07-24)
216
217
218### Bug Fixes
219
220* make a more sensible decision about matching body ([0ef50d6](https://github.com/wheresrhys/fetch-mock/commit/0ef50d62ccaa70ea09b693519ddb80d73530b38f))
221
222## [0.4.2](https://github.com/wheresrhys/fetch-mock/compare/core-v0.4.1...core-v0.4.2) (2024-07-24)
223
224
225### Features
226
227* make query parameters available on CallLog ([8ec57ac](https://github.com/wheresrhys/fetch-mock/commit/8ec57acdc2586102fc94a76f3f3328422e43947f))
228
229## [0.4.0](https://github.com/wheresrhys/fetch-mock/compare/core-v0.3.1...core-v0.4.0) (2024-07-24)
230
231
232### ⚠ BREAKING CHANGES
233
234* defined route shorthand methods more declaratively
235
236### refactor
237
238* defined route shorthand methods more declaratively ([f42d240](https://github.com/wheresrhys/fetch-mock/commit/f42d240f8ef5c6a270ee8b355ad5177d8fdadf0b)). This includes removing all the `${method}Any()` and `${method}AnyOnce()` methods.
239
240## [0.3.1](https://github.com/wheresrhys/fetch-mock/compare/core-v0.3.0...core-v0.3.1) (2024-07-23)
241
242
243### Documentation Changes
244
245* fixed tests and documented the async behaviour ([664a6df](https://github.com/wheresrhys/fetch-mock/commit/664a6df59a77937e18f19aa161ec4900fa709bfe))
246
247## [0.3.0](https://github.com/wheresrhys/fetch-mock/compare/core-v0.2.0...core-v0.3.0) (2024-07-21)
248
249
250### ⚠ BREAKING CHANGES
251
252* matchers now take normalized requests as input
253* renamed func to matcherFunction
254* removed support for passing in a matcher under the generic name matcher
255* renamed functionMatcher to func
256
257### refactor
258
259* matchers now take normalized requests as input ([da9dfe8](https://github.com/wheresrhys/fetch-mock/commit/da9dfe80475f2c95ea9a3652bfe8682ccd4c65fd))
260
261
262### Features
263
264* can now access express parameters in responses ([41e2475](https://github.com/wheresrhys/fetch-mock/commit/41e2475d64d909f5fb686f2fe3709243326f2dba))
265* removed support for passing in a matcher under the generic name matcher ([f41d8f9](https://github.com/wheresrhys/fetch-mock/commit/f41d8f909350961e40a4df9dfb4817a3eaba09cd))
266* renamed func to matcherFunction ([e5679a7](https://github.com/wheresrhys/fetch-mock/commit/e5679a72f663d5187d08934aa510951f1d438adc))
267* renamed functionMatcher to func ([4cee629](https://github.com/wheresrhys/fetch-mock/commit/4cee629b36cd618d6d5b1061c15e48aab7047969))
268* response builder function now expects a calllog ([306357d](https://github.com/wheresrhys/fetch-mock/commit/306357db486c9c7aa621f430cd08621420efc724))
269
270## [0.2.0](https://github.com/wheresrhys/fetch-mock/compare/core-v0.1.1...core-v0.2.0) (2024-07-20)
271
272
273### ⚠ BREAKING CHANGES
274
275* removed top level done and flush methods
276
277### Features
278
279* removed top level done and flush methods ([49ae6f7](https://github.com/wheresrhys/fetch-mock/commit/49ae6f7671a2ce10f0a31bafd3eb9e1d7ce5cf2d))
280
281
282### Bug Fixes
283
284* callhistory created with instance.config, not this.config ([87206e6](https://github.com/wheresrhys/fetch-mock/commit/87206e69e71e1270932fe322c79f0b42cac486c6))
285
286## [0.1.1](https://github.com/wheresrhys/fetch-mock/compare/core-v0.1.0...core-v0.1.1) (2024-07-18)
287
288
289### Features
290
291* **wip:** replace dequal, glob-to-regexp and bump path-to-regexp ([d8d8b25](https://github.com/wheresrhys/fetch-mock/commit/d8d8b259fffbd01a03d5c5bf2768ee48797b68bb))
292
293
294### Bug Fixes
295
296* replace path-to-regexp with regexparam ([4bf3e32](https://github.com/wheresrhys/fetch-mock/commit/4bf3e32f852ffc169ca354288eff86737e131480))
297
298## 0.1.0 (2024-07-15)
299
300
301### Bug Fixes
302
303* install core package dependencies ([9c73e76](https://github.com/wheresrhys/fetch-mock/commit/9c73e76686427237a99ababa44075ca426b22037))