Skip to content

Releases: mswjs/msw

v0.45.0

22 Aug 00:32
Compare
Choose a tag to compare

v0.45.0 (2022-08-22)

Features

  • make GraphQL a peer dependency, support GraphQL v15.0 (#1356) (ca0e2e0)

v0.44.2

19 Jul 00:41
Compare
Choose a tag to compare

v0.44.2 (2022-07-19)

Bug Fixes

  • transfer mocked response as ArrayBuffer to the worker (#1337) (95be5f8)

v0.44.1

14 Jul 16:05
Compare
Choose a tag to compare

v0.44.1 (2022-07-14)

Bug Fixes

v0.44.0

13 Jul 00:33
Compare
Choose a tag to compare

v0.44.0 (2022-07-13)

Breaking changes

  • req.destination default value is now "" (empty string), previously "document".
  • req.redirect default value is now ""follow", previously "manual".
  • The library no longer exports the parseIsomorphicRequest() function (#1316). Please use MockedRequest class instead.

Features

  • adhere to Fetch API "Request" in response resolver (#1316, @95th) (fc7f00c). This means the addition of a few properties on the req instance:
    • 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 as ArrayBuffer;
    • 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.body is deprecated. Please use explicit request body reading methods: req.text(), req.json(), req.arrayBuffer() (other methods, like req.formData() are currently not supported).
rest.post('/user', async (req, res, ctx) => {
  const newUser = await req.json()
})

req.body is still present for compatibility reasons but will be removed in the next releases.

v0.43.1

07 Jul 00:31
Compare
Choose a tag to compare

v0.43.1 (2022-07-07)

Bug Fixes

  • support multiple response cookies using "ctx.cookie()" (#1311) (66c3ad8)

v0.43.0

04 Jul 00:30
Compare
Choose a tag to compare

v0.43.0 (2022-07-04)

Features

  • send mocked response body as ReadableStream to the worker (#1288) (78c7d7e)

v0.42.3

22 Jun 23:17
Compare
Choose a tag to compare

v0.42.3 (2022-06-22)

Bug Fixes

v0.42.2

22 Jun 12:48
Compare
Choose a tag to compare

v0.42.2 (2022-06-22)

Bug Fixes

  • setupServer: reference interceptors to support fast refresh (#1299) (72f0b25)

v0.42.1

07 Jun 23:15
Compare
Choose a tag to compare

v0.42.1 (2022-06-07)

Bug Fixes

v0.42.0

30 May 23:14
Compare
Choose a tag to compare

v0.42.0 (2022-05-30)

Features

Bug Fixes