chore(deps): update dependency msw to v0.49.3
This MR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| msw (source) | 0.35.0 -> 0.49.3 |
Release Notes
mswjs/msw
v0.49.3
v0.49.3 (2023-01-19)
Bug Fixes
- use EventTarget-based event emitter (#1522) (
6a94b8c) @chrisguttandin
v0.49.2
v0.49.2 (2022-12-13)
Bug Fixes
- use
globalThis.fetchinctx.fetchutility (#1490) (42cdbc7) @Toxiapo @kettanaito
v0.49.1
v0.49.1 (2022-11-28)
Bug Fixes
-
setupWorker: resolve the TS4094 error (#1477) (
c268796) @gduliscouet-ubitransport
v0.49.0
v0.49.0 (2022-11-19)
Features
v0.48.3
v0.48.3 (2022-11-15)
Bug Fixes
-
SetupApi: validate given request handlers (#1460) (
a06a944) @kettanaito - inline
statusesdependency during the build (#1458) (99d49f9) @mattcosta7 @kettanaito
v0.48.2
v0.48.2 (2022-11-13)
Bug Fixes
- resolve absolute worker url against the current path (#1456) (
f8d15b4) @kettanaito
v0.48.1
v0.48.1 (2022-11-10)
Bug Fixes
- bufferUtils import path (#1453) (
91b2902) @cksal0805
v0.48.0
v0.48.0 (2022-11-08)
Features
- add "SetupApi" base class (#1445) (
85ba844) @Toxiapo @kettanaito - do not interfere with shared workers (#1448) (
670dda7) @mucsi96 @kettanaito - makes the library esm-compatible (#1399) (
41798eb) @ivanhofer @kettanaito
v0.47.4
v0.47.4 (2022-10-04)
Bug Fixes
- correctly link types in
package.jsonexportsfield (#1395) (3902b8c) @ivanhofer @kettanaito - include error stack in log when handling uncaught exceptions (#1417) (
933a9d6) @jkieboom @kettanaito - remove duplicate response logging in the browser console (#1418) (
78d155f) @snaka @kettanaito
v0.47.3
v0.47.3 (2022-09-15)
Bug Fixes
- update "headers-polyfill" and "@mswjs/interceptors" to fix "/lib" issue (#1407) (
41d8c08)
v0.47.2
v0.47.2 (2022-09-13)
Bug Fixes
v0.47.1
v0.47.1 (2022-09-10)
Bug Fixes
v0.47.0
v0.47.0 (2022-09-04)
Features
v0.46.1
v0.46.1 (2022-09-01)
Bug Fixes
v0.46.0
v0.46.0 (2022-08-31)
Features
- fix a typo in the worker script (
62f7c4d) - support typescript v4.8 (#1375) (
631f629) - add "listHandlers" method to server and worker (#1369) (
18f5778)
server.listHandlers()
worker.listHandlers()
v0.45.0
v0.45.0 (2022-08-22)
Features
v0.44.2
v0.44.2 (2022-07-19)
Bug Fixes
v0.44.1
v0.44.1 (2022-07-14)
Bug Fixes
v0.44.0
v0.44.0 (2022-07-13)
Breaking changes
-
req.destinationdefault value is now""(empty string), previously"document". -
req.redirectdefault value is now""follow", previously"manual". - The library no longer exports the
parseIsomorphicRequest()function (#1316). Please useMockedRequestclass instead.
Features
- adhere to Fetch API "Request" in response resolver (#1316, @95th) (
fc7f00c). This means the addition of a few properties on thereqinstance:-
req.priority, indicates a priority of request relatively to other requests (default"auto"); -
req.text(), reads the request body as plain text; -
req.json(), reads the request body as JSON; -
req.arrayBuffer(), reads the request body asArrayBuffer; -
req.clone(), clones a request instance (i.e. so its body could be read multiple times).
-
- remove unnecessary stringification of worker-client messages (#1320) (
6990c3a)
Deprecations
-
req.bodyis deprecated. Please use explicit request body reading methods:req.text(),req.json(),req.arrayBuffer()(other methods, likereq.formData()are currently not supported).
rest.post('/user', async (req, res, ctx) => {
const newUser = await req.json()
})
req.bodyis still present for compatibility reasons but will be removed in the next releases.
v0.43.1
v0.43.1 (2022-07-07)
Bug Fixes
v0.43.0
v0.43.0 (2022-07-04)
Features
v0.42.3
v0.42.3 (2022-06-22)
Bug Fixes
v0.42.2
v0.42.2 (2022-06-22)
Bug Fixes
v0.42.1
v0.42.1 (2022-06-07)
Bug Fixes
v0.42.0
v0.42.0 (2022-05-30)
Features
- upgrade to @mswjs/interceptors 0.16 (#1262) (
2176577)
Bug Fixes
v0.41.1
v0.41.1 (2022-05-27)
Bug Fixes
v0.41.0
v0.41.0 (2022-05-22)
Features
v0.40.2
v0.40.2 (2022-05-20)
Bug Fixes
v0.40.1
v0.40.1 (2022-05-19)
Bug Fixes
v0.40.0
v0.40.0 (2022-05-17)
Breaking changes
- Returning
undefined, or early returns, from response resolvers, now does not perform request as-is, and is instead treated as a handler that didn't do anything. Please returnreq.passthrough()if you wish to bypass a request.
rest.get('/resource', (req, res, ctx) => {
// I want to perform this intercepted request as-is.
- return
+ return req.passthrough()
})
Features
- add "unhandledException" life-cycle event (#1199) (
5c90799) - improve PathParams type to support interface (#1219) (
b70266f) - rename "DefaultRequestBody" to "DefaultBodyType" (
53aa3a1) - add "req.passthrough" (#1204) (
4e1b1ad) - add service worker scope and worker script URL to "Mocking enabled" message (#1172) (
ab3d399) - set "typescript" optional peer dependency to 4.2.x (#985) (
b1004a6)
Bug Fixes
-
setupWorker: warn on multiple "worker.start" and "worker.stop" calls (#1238) (
cfe0709) - remove console.log from "setRequestCookies" (
6f7ed98) - set "credentials" to "same-origin" for "ClientRequest" (#1159) (
c3cd80a)
v0.39.2
Bug Fixes
- parseIsomorphicRequest: bypassing cookies properly (#1155) (755bc9d)
- set "credentials" to "same-origin" for "ClientRequest" (#1159) (c3cd80a)
- set minimal supported Node.js version to 14 (#1160) (d7ab139)
v0.39.1
Bug Fixes
v0.39.0
Breaking changes
Bug Fixes
v0.38.2
Bug Fixes
- update @mswjs/interceptors to 0.13.5 (#1127) (1b59ab7)
v0.38.1
Bug Fixes
v0.38.0
Features
- update to @mswjs/interceptors 0.13.3 (#1095) (e288d18), closes #1102
- allow default behavior of
onUnhandledRequestin a custom callback (https://github.com/mswjs/msw/pull/1096):
worker.start({
onUnhandledRequest(request, print) {
// Ignore unhandled warnings/errors from asset requests.
if (request.url.href.includes('/assets/') {
return
}
// Otherwise, execute the default warning/error/ strategy.
print.warning() // or "print.error()"
}
})
v0.36.8
Bug Fixes
v0.36.7
Bug Fixes
- update "@mswjs/cookies" for safe
localStorageaccess (#1071) (99ae530) - update
node-fetchto 2.6.7 to fix a security vulnerability (#1072) (72a34f6)
v0.36.5
Bug Fixes
v0.36.4
Bug fixes
v0.36.3
Bug fixes
- Fixes an issue that resulted in the CORS policy violation due to the library appending the
x-msw-request-idrequest header (#713, #1022, #1024).
Internal
- No longer sets the
x-msw-request-idheader on the request (#1024). Relies on therequest.idset by the interceptors (Node.js) or therequestIdgenerated by the worker (browser).
v0.36.2
Bug fixes
- Fixes an issue that resulted in the "TypeError: expected.toLowerCase() is not a function" exception when using the
rest.all()request handler (#1020, #1021).
v0.36.1
Bug fixes
- Fixes an issue that resulted in the "SyntaxError: Invalid group specified name" exception in Safari (#1018, #1019 ).
v0.36.0
Breaking changes
- Uses path-to-regexp for URL matching (#691, #888). This makes the path matching experience identical to such in ExpressJS, and enabled various new features:
- Optional path segments (
/foo/bar?); - Repeating groups (
/foo/bar+).
- Optional path segments (
- Request path parameters are now annotated as ambiguous
string | string[](#999). - The
RequestParamsgeneric now follows theRequestBodyTypegeneric, changing its order (#999):
rest.post<RequestBodyType, RequestParams, ResponseBodyType>() {}
- Removes the
RequestParamstype (#999). Please use thePathParamstype instead.
- import { RequestParams } from 'msw'
+ import { PathParams } from 'msw'
- Relative requests are now resolved against
document.baseURI(previouslylocation.origin) in a browser-like environments (#1007, #1008).
Features
- Adds a new
rest.all()request handler (#896). This handler captures all REST API requests regardless of method.
import { rest } from 'msw'
rest.all('/api/*', (req, res, ctx) => {
// Intercepts all requests to "/api/*"
// regardless of their method.
})
graphql.query('GetUser', (req, res, ctx) => {
return res(
ctx.extensions({
message: 'Mocked extension',
tracking: { version: '1.2.3' }
})
)
})
- Exports
SetupWorkerApiandSetupServerApifrom the browser and Node.js modules respectively (#994).
Bug fixes
- Specifies
typescriptas apeerDependencyto control supported TypeScript versions (#985). - Fixes an issue that resulted in
graphql.operationhandler producing a warning unable to intercept anonymous operations (#918, #904). - Locks
inquirerdependency version to 8.1.5 to propagate the fix for theUnexpected token “?”issue when using MSW CLI (#917). - Fixes an issue that resulted in the
TypeError: Failed to execute 'XXX' on 'Response': body stream already readerror when reading the original response body in the fallback mode (https://github.com/mswjs/interceptors/pull/152).
Internal
- Lists
@mswjs/cookiesand@mswjs/interceptorsas external packages so that their updates propagate to you automatically upon new installations ofmsw. - Updates dependencies.
Configuration
-
If you want to rebase/retry this MR, click this checkbox.
This MR has been generated by Renovate Bot.
Edited by Renovate (Bot)