Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update dependency msw to v0.49.3 - autoclosed #74

Closed
wants to merge 1 commit into from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Oct 11, 2023

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
msw (source) 0.0.0-fetch.rc-19 -> 0.49.3 age adoption passing confidence

Release Notes

mswjs/msw (msw)

v0.49.3

Compare Source

v0.49.3 (2023-01-19)

Bug Fixes

v0.49.2

Compare Source

v0.49.2 (2022-12-13)
Bug Fixes

v0.49.1

Compare Source

v0.49.1 (2022-11-28)

Bug Fixes

v0.49.0

Compare Source

v0.49.0 (2022-11-19)

Features

v0.48.3

Compare Source

v0.48.3 (2022-11-15)

Bug Fixes

v0.48.2

Compare Source

v0.48.2 (2022-11-13)

Bug Fixes

v0.48.1

Compare Source

v0.48.1 (2022-11-10)

Bug Fixes

v0.48.0

Compare Source

v0.48.0 (2022-11-08)

Features

v0.47.4

Compare Source

v0.47.4 (2022-10-04)

Bug Fixes

v0.47.3

Compare Source

v0.47.3 (2022-09-15)

Bug Fixes

v0.47.2

Compare Source

v0.47.2 (2022-09-13)

Bug Fixes

v0.47.1

Compare Source

v0.47.1 (2022-09-10)

Bug Fixes

v0.47.0

Compare Source

v0.47.0 (2022-09-04)

Features

v0.46.1

Compare Source

v0.46.1 (2022-09-01)

Bug Fixes

v0.46.0

Compare Source

v0.46.0 (2022-08-31)

Features
server.listHandlers()
worker.listHandlers()

v0.45.0

Compare Source

v0.45.0 (2022-08-22)

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

v0.44.2

Compare Source

v0.44.2 (2022-07-19)

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

v0.44.1

Compare Source

v0.44.1 (2022-07-14)

Bug Fixes

v0.44.0

Compare Source

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
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

Compare Source

v0.43.1 (2022-07-07)

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

v0.43.0

Compare Source

v0.43.0 (2022-07-04)

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

v0.42.3

Compare Source

v0.42.3 (2022-06-22)

Bug Fixes

v0.42.2

Compare Source

v0.42.2 (2022-06-22)

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

v0.42.1

Compare Source

v0.42.1 (2022-06-07)

Bug Fixes

v0.42.0

Compare Source

v0.42.0 (2022-05-30)

Features
Bug Fixes

v0.41.1

Compare Source

v0.41.1 (2022-05-27)

Bug Fixes

v0.41.0

Compare Source

v0.41.0 (2022-05-22)

Features

v0.40.2

Compare Source

v0.40.2 (2022-05-20)

Bug Fixes

v0.40.1

Compare Source

v0.40.1 (2022-05-19)

Bug Fixes

v0.40.0

Compare Source

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 return req.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
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

Compare Source

Bug Fixes

v0.39.1

Compare Source

Bug Fixes

v0.39.0

Compare Source

Breaking changes
Bug Fixes
  • setupWorker: resolve the "start" promise after the worker has activated (#​1146) (f6e709c)

v0.38.2

Compare Source

Bug Fixes

v0.38.1

Compare Source

Bug Fixes
  • handleRequest: bypass request only if "x-msw-bypass" header equals "true" (#​1110) (1a7bc36)

v0.38.0

Compare Source

Features
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

Compare Source

Bug Fixes

v0.36.7

Compare Source

Bug Fixes

v0.36.5

Compare Source

Bug Fixes
  • parse request body with letter case Content-Type header value (#​1064) (7796418)

v0.36.4

Compare Source

Bug fixes

  • Fixes an issue that resulted in port numbers being treated as path parameters (#​1036, #​1028).

v0.36.3

Compare Source

Bug fixes

  • Fixes an issue that resulted in the CORS policy violation due to the library appending the x-msw-request-id request header (#​713, #​1022, #​1024).

Internal

  • No longer sets the x-msw-request-id header on the request (#​1024). Relies on the request.id set by the interceptors (Node.js) or the requestId generated by the worker (browser).

v0.36.2

Compare Source

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

Compare Source

Bug fixes

  • Fixes an issue that resulted in the "SyntaxError: Invalid group specified name" exception in Safari (#​1018, #​1019 ).

v0.36.0

Compare Source

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+).
  • Request path parameters are now annotated as ambiguous string | string[] (#​999).
  • The RequestParams generic now follows the RequestBodyType generic, changing its order (#​999):
rest.post<RequestBodyType, RequestParams, ResponseBodyType>() {}
  • Removes the RequestParams type (#​999). Please use the PathParams type instead.
- import { RequestParams } from 'msw'
+ import { PathParams } from 'msw'
  • Relative requests are now resolved against document.baseURI (previously location.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.
})
  • Supports encoded request path components (#​980).
  • Supports mocking GraphQL extensions (#​981).
graphql.query('GetUser', (req, res, ctx) => {
  return res(
    ctx.extensions({
      message: 'Mocked extension',
      tracking: { version: '1.2.3' }
    })
  )
})
  • Exports SetupWorkerApi and SetupServerApi from the browser and Node.js modules respectively (#​994).
Bug fixes
  • Specifies typescript as a peerDependency to control supported TypeScript versions (#​985).
  • Fixes an issue that resulted in graphql.operation handler producing a warning unable to intercept anonymous operations (#​918, #​904).
  • Locks inquirer dependency version to 8.1.5 to propagate the fix for the Unexpected token “?” issue when using MSW CLI (#​917).
  • Fixes an issue that resulted in the TypeError: Failed to execute 'XXX' on 'Response': body stream already read error when reading the original response body in the fallback mode (https://github.com/mswjs/interceptors/pull/152).
Internal
  • Lists @mswjs/cookies and @mswjs/interceptors as external packages so that their updates propagate to you automatically upon new installations of msw.
  • Updates dependencies.

v0.35.0

Compare Source

v0.34.0

Compare Source

v0.33.3

Compare Source

v0.33.2

Compare Source

v0.33.1

Compare Source

v0.33.0

Compare Source

v0.32.3

Compare Source

v0.32.2

Compare Source

v0.32.1

Compare Source

v0.32.0

Compare Source

v0.31.0

Compare Source

v0.30.1

Compare Source

v0.30.0

Compare Source

v0.29.0

Compare Source

v0.28.2

Compare Source

Bug fixes
  • Fixes an issue when req.params was undefined in case when request path had no parameters present (#​682, #​684). The req.params value is always an object, regardless if you have path parameters defined.

v0.28.1

Compare Source

Bug fixes
  • Fixes the issue that resulted in the "Cannot read property 'id' of undefined" in iframe scenarios (#​643, #​645).
  • Fixes the issue when making an explicit return in a handler considered the request unhandled in Node.js (#​655, #​672).
  • Fixes the issue that resulted in a multipart form data not being parsed correctly given extra spaces or the lack of such in the Content-Type header (#​671).

v0.28.0

Compare Source

Breaking changes
  • The response instance in the life-cycle events now handles response.headers as the Headers instance (#​660).
server.on('response:bypass', (res) => {
-  res.headers['content-type']
+  res.headers.get('content-type')
})
  • Calling setupServer no longer applies request interception immediately. Instead, it's applied when called server.listen() (#​660).
Bug fixes
  • Fixes the order of events in the intercepted XMLHttpRequest in Node.js (https://github.com/mswjs/interceptors/pull/102).
  • Fixes an issue that resulted in the "TypeError [ERR_INVALID_PROTOCOL]: Protocol "http:" not supported. Expected "https:"" exception when using MSW with superagent (#​632).
Internal

v0.27.2

Compare Source

Bug fixes
  • Fixes a backward-compatibility issue of the DropFirstInTuple type used internally in compose.ts (#​658).
  • Fixes an issue in IE11 when retrieving a stack trace of a handler would throw an exception (#​647).
  • Fixes an issue when a stream in a response body would cause a response timeout (#​602).
  • Fixes an issue when a cookie retrieval would cause a Fast Refresh to break in Next.js (#​649).

v0.27.1

Compare Source

Changes

  • Exports the RestHandler class publicly.

Bug fixes

  • Fixes an issue that caused a Uncaught ReferenceError: process is not defined exception when calling worker.start() (#​609, #​629).
  • Fixes an issue that caused a TypeScript violation in the PickLastInTuple type (#​615, #​627).
  • Fixes an issue that caused an TypeError: Object.fromEntries is not a function error when running MSW in Node.js v10 (#​625, #​633).

Internals

v0.27.0

Compare Source

Breaking changes

  • The Promise returned by worker.start() will now reject in the case of any errors during the worker registration (#​607).
  • The library no longer exports the following TypeScript declarations:
    • RestRequestType, use RestRequest instead.
    • GraphQLMockedRequest, use GraphQLRequest instead.
    • GraphQLMockedContext, use GraphQLContext instead.
    • GraphQLRequestPayload, use GraphQLRequestBody instead.
    • GraphQLRequestParsedResult, use ParsedGraphQLRequest instead.
    • GraphQLResponseResolver
  • The values of the MockedRequest type no longer have the params key (#​561). Please use the RestRequest type to annotate REST API requests instead.

Features

  • Supports automatic worker script updates (#​606). Respects the msw.workerDirectory property in your package.json:
{
  "msw": {
    "workerDirectory": "public"
  }
}

Starting from this release, whenever you install msw, it will try to locate the msw.workerDirectory property in your package.json and copy the relevant worker script (mockServiceWorker.js) to that directory.

Whenever running msw init now, you will be prompted to save your public directory choice to package.json.

  • When running msw init you can pass the —save option to automatically save the public directory in your package.json for future worker updates (#​606). You can alternatively use --no-save to bail out this step.
  • Intercepts requests originating from an iframe (#​589).
  • Adds virtual cookie store to ensure the persistency of cookies received from the same domains across multiple requests (#​435, #​469).

Bug fixes

  • Fixes an issue when a request body type generic had no effect on the response composition chain validation.
  • Fixes an issue when a 204 response threw an exception when the library emitted its response:* life-cycle events (#​570).

Internal

  • Rebuilds the Request Handler API from ground-up (#​561). Does not introduce any breaking changes in how you use the handlers.
  • Fixes the auto-imports of the library’s methods suggested by IDE (#​598).
  • Updates the dependencies.

v0.26.2

Compare Source

Bug fixes
  • Fixes an issue that resulted in GraphQL request handlers not annotating the mocked response structure based on the given generic type (#​587).
  • Fixes an issue when a one-time request handler (res.once) affected multiple matching requests made in parallel (#​583).
  • Properly exports the renamed OnUnhandledRequest type as the new UnhandledRequestStrategy type (#​577).

v0.26.1

Compare Source

Features
  • onUnhandledRequest option will now suggest similar request handlers based on the URL/operation name similarity (#​560).
Bug fixes
  • Fixes an issue that resulted in a 202 status response throwing an exception when the library attempted to re-create its Response instance for the response:* life-cycle event (#​570).
  • Fixes an issue when a request handler stack trace wasn't handled properly on Windows machines (#​566).
  • Fixes an issue when using the onUnhandledRequest: "error" option resulted in a thrown exception being gracefully handled by Axios (#​544). The "error" value now prints to stderr directly instead of throwing an exception. An original request-related exception will become visible now as well.

v0.26.0

Compare Source

This release introduces changes to the mockServiceWorker.js file. Please follow the instructions in the browser to update the worker file. Thank you.

Features
  • Adds support for GraphQL upload and multipart data operations (#​215, #​543).
  • Adds delay modes: “real” and “infinite” (#​538). Supports infinite loading.
ctx.delay() // random realistic response time
ctx.delay('real') // the same as `ctx.delay()`
ctx.delay('infinite') // infinite response time
ctx.delay(50) // explicit response delay (50ms)
  • Displays [MSW] Mocking disabled message when calling worker.stop(). (#​485, #​493).
Bug fixes
  • Fixes an issue that resulted in theFailed to construct 'Response': The status provided (0) is outside the range [200, 599]. exception caused by an opaque response on the page (#​529, #​564). MSW will now skip opaque responses during the life-cycle events handling. You will not get the response:bypass invoked upon an opaque response.
  • Fixes an issue that resulted in an exception being thrown when handling subsequent requests in Safari (#​558, #​565).
  • Fixes an issue when the ExecutionResult of graphql was not compatible with ctx.data and ctx.errors utilities (#​522, #​542).
  • Fixes an issue that resulted in the MSW worker handling unrelated message event originating from other tools (#​551).
Internal
  • Updates dependencies to their latest versions.
  • Consistently uses self instead of this in the worker script (#​568).
  • Ensures that MSW doesn’t handle events originating from unrelated workers (#​551).

v0.25.0

Compare Source

Features

v0.24.4

Compare Source

Features

  • Exports the RestContext type interface for public consumption (#​524).

v0.24.3

Compare Source

Features
  • Publishes the library in IIFE format, allowing to use it from a <script> tag (#​507, #​509).
Internal
  • Updates package's dependencies (#​521).

v0.24.2

Compare Source

v0.24.1

Compare Source

Improvements
  • Ships with refined JSDoc support (#​483). Most of the core functions and methods now include concise description, usage example, and a link to the docs.

v0.24.0

Compare Source

Breaking changes
  • ctx.json context utility now always stringifies the response body (#​468).
  • Removes JSON response body transformer as the default response body transformer. Nothing implicitly transforms the response body now.
Migration guidelines
  • Replace custom response transformers that might have affected the end response body, such as custom serializers, with custom response transformers.
Bug fixes
  • Fixes an issue that resulted in a response body being stringified twice (#​466).

v0.23.0

Compare Source

Features
import { ResponseTransformer, compose } from 'msw'
import base64Image from 'url-loader!../../fixtures/image.jpg'

async function jpeg(base64: string): Promise<ResponseTransformer> {
  const buffer = await fetch(base64).then((res) => res.arrayBuffer())

  return compose(
    context.set('Content-Length', buffer.byteLength.toString()),
    context.set('Content-Type', 'image/jpeg'),
    context.body(buffer),
  )
}

const worker = setupWorker(
  rest.get('/image', async (req, res, ctx) => {
    return res(await jpeg(base64Image))
  }),
})
  • Publicly exposes the compose function (#​467).
import { compose } from 'msw'

v0.22.3

Compare Source

Features

v0.22.2

Compare Source

Bug fixes
  • Fixes an issue that resulted into a "Duplicate parameter" exception in Safari (#​470).
  • Fixes an issue where the setupServer function had no explicitly provided return type signature (#​458).

v0.22.1

Compare Source

Bug fixes
  • Fixes an issue that resulted into Content-Type: application/json request body not being parsed as a JSON whenever it had an additional charset header value (#​462, #​463).
Internals
  • Updates package dependencies.

v0.22.0

Compare Source

Breaking changes
Features
  • Supports setting both ctx.data and ctx.errors in GraphQL responses (#​401, #​403).
graphql.query('GetUser', (req, res, ctx) => {
  return res(
    ctx.data({ id: 'abc-123' }),
    ctx.errors([
      { message: 'Failed to get user posts' }
    ])
  )
})
  • Supports creation of custom response transformers (#​440, #​441).
Bug fixes
  • Fixes an issue that resulted into inferred response status texts always set to "OK" (#​438).

v0.21.3

Compare Source

Features
  • Adds support for type annotation of path parameters (#​393, #​421).
rest.get<RequestType, ResponseType, RequestParamsType>(url, resolver)
  • Validates the value given to the setupWorker/setupServer functions to be a spread list of handlers, not an Array (#​400, #​402).
Bug fixes
  • Fixes an issue that caused a TypeScript compilation to fail when importing the graphql handler by exporting the GraphQLRequestParsedResult type from the package (#​425).

v0.21.2

Compare Source

Bug fixes
  • Fixes type annotations of ResponseTransformer to drop the usage of the unknown generics causing type violations in strict mode (#​381, #​382).

v0.21.1

Compare Source

Bug fixes
  • Fixes an issue that resulted into TypeScript violations in strict mode (#​377, #​379).

v0.21.0

Compare Source

This release contains changes to the mockServiceWorker.js file. Please follow the instructions in your browser to upgrade the Service Worker file.

Breaking changes
  • ctx.fetch utility now returns the entire response, not just the body (#​373).
- const body = await ctx.fetch(req)
+ const response = await ctx.fetch(req)
+ const body = await response.json()
Features
  • Adds support for mocking any GraphQL operation regardless of its type via graphql.operation API (#​343).
import { graphql } from 'msw'

graphql.operation((req, res, ctx) => {
  const { query, variables } = req.body

  // Execute any GraphQL operation against a mock schema
  // and return the response.
  return executeSchema(mockSchema, { query, variables })
})
  • Adds support for request and response body type generics to rest.* request handlers (#​345, #​352).
import { rest } from 'msw'

interface UserResponseBodyType {
  firstName: string
}

rest.get<never, UserResponseBodyType>('/user', (req, res, ctx) => {
  return res(ctx.json({ firstName: ‘John’ })
})

interface TodoRequestBodyType {
  title: string
}

type TodoResponseBodyType = string[]

rest.post<TodoRequestBodyType, TodoResponseBodyType>('/todo', (req, res, ctx) => {
  const { title } = req.body
  return res(ctx.json(['one', title]))
})
  • Adds support to rest.head() request handler to match HEAD method requests (#​356).
  • Adds findWorker option to worker.start() to locate the mock Service Worker script at a custom location (#​335, #​351).
  • Adds a keepalive mechanism between a client and the Service Worker to prevent the worker to be terminated due to inactivity (#​367, #​371).
  • ctx.json now supports any data types that can be serialized to a valid JSON (#​349, #​350).
Bug fixes
Internals
  • Adjusts internal tooling to support contributors with Windows machines (#​363, #​364).
  • Updates dependencies (#​376).

v0.20.5

Compare Source

Bug fixes
  • Fixes an issue that resulted into a Export has or is using name 'ParsedRestRequest' from external module error message when compiling a TypeScript project using MSW (#​325, #​333).
  • Fixes an issue that resulted into a wrong Service Worker registration being picked up on platforms that register their own workers (i.e. Codesandbox) (#​289).
Dependencies
  • Updates node-request-interceptor to version 0.3.5 (see Changelog).

v0.20.4

Compare Source

Bug fixes
  • Fixes an issue that produces a "Must provide source" error during GraphQL parsing of POST requests with body, but without the query property (#​234, #​328, #​329).
  • Fixes an issue that resulted into http module being patched in React Native environment, where it's not present (#​203, #​331).
Dependencies

v0.20.3

Compare Source

Bug fixes
  • Fixes an issue that resulted into the first matching request handler being treated as the only relevant request handler, even if it doesn't return any mocked response (#​234, #​258, #​265).

v0.20.2

Compare Source

Features
  • Adds graphql.link request handler that allows to mock GraphQL operations on per-endpoint basis (#​315, #​319).
import { setupWorker, graphql } from 'msw'

const github = graphql.link('https://api.github.com/graphql')
const stripe = graphql.link('https://api.stripe.com/graphql')

const worker = setupWorker(
  github.query('GetUser', resolver),
  stripe.mutation('Payment', resolver),
)

worker.start()
Bug fixes
  • Fixes a TypeScript issue that resulted into the following error (#​321, #​322):
ERROR in node_modules/msw/lib/types/context/cookie.d.ts:1:8 - error TS1192:
Module '"/node_modules/@&#8203;types/cookie/index"' has no default export.

v0.20.1

Compare Source

Bug fixes

  • Fixes an issue with the node-fetch dependency that wasn't listed as a save dependency (#​308)
  • Fixes an issue that resulted into the React Native build module at /native not being published to NPM (#​309)

v0.20.0

Compare Source

Breaking changes

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot force-pushed the renovate/msw-0.x branch 10 times, most recently from 82d26f3 to fb080d4 Compare October 18, 2023 18:47
@renovate renovate bot force-pushed the renovate/msw-0.x branch 3 times, most recently from 4b95d73 to 6dd854a Compare October 21, 2023 00:50
@renovate renovate bot force-pushed the renovate/msw-0.x branch from 6dd854a to 17e2a5d Compare October 23, 2023 11:21
@renovate renovate bot changed the title chore(deps): update dependency msw to v0.49.3 chore(deps): update dependency msw to v0.49.3 - autoclosed Oct 23, 2023
@renovate renovate bot closed this Oct 23, 2023
@renovate renovate bot deleted the renovate/msw-0.x branch October 23, 2023 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants