Create your own GitHub profile
Sign up for your own profile on GitHub, the best place to host code, manage projects, and build software alongside 50 million developers.
Sign up- Prague, Czech Republic
- https://redd.one
Pinned
1,635 contributions in the last year
Contribution activity
May 2020
Created a pull request in kentcdodds/bookshelf that received 10 comments
Reuses the same mock definitions for unit tests
Motivation
Replaces manual fetch-mock.js with a built-in solution for running mocks in NodeJS from MSW.
Changes
Uses setupServer function from msw…
+196
−215
•
10
comments
- Uses "req.headers.getAllHeaders()" for response patching
- Adds code linting
- Lists "node-request-interceptor" as an external dependency
- Parses empty GET request body as undefined
- Extends request handler with "parse" and "getPublicRequest" methods
- Provide different logs for REST and GraphQL
- Adds integration test for GraphQL in Node
- setupServer: Parses a request JSON body
- Parses a JSON request body of the intercepted request
- logger: Compares "req.referrer" to "req.url.origin" to determine if request is relative
- Fixes a broken "request.body" retrieval in the Service Worker
- rest: Converts methods to upper case before comparing
- Unregisters itself when clients.matchAll() is empty
- fetch: Gets JSON body only if the respective Content-Type is set
- Provides a meaningful error message when Service Worker is not supported
- Supports running mocks in Node
- Replaces negative lookbehind with URL constructor
- Supports path parameters in paths with query
- Support tree shaking
- Adds CLI init command integration tests
- Fixes invariant predicate for "init" command
- Fixes broken worker file copying on "msw init"
- Removes forceful reload on found update
- Adds internal improvements
- XMLHttpRequest: resolves DONE readyState on mocked response
- Removes unused "getCleanUrl" utility
- Sets build target to "es5" to support export from
- Returns a URL instance as "req.url" value
- Exports "getCleanUrl" utility
- XHR: Supports relative request URL
- Fixes jest-environment typo
- Uses "headers-utils" package
- Adds more testing scenarios
Created an issue in mswjs/msw that received 4 comments
Empty request JSON body throws exception in a request handler
Describe the bug
When attempting to parse a JSON body, which is empty, an exception seems to happen.
Environment
msw: 0.16.2
Expected behavior
Em…
4
comments
- Cannot patch a response: req.headers and HeadersInit types are incompatible
- Add linter
- Request JSON body is not parsed in Node
- Text request body is not sent from the Service Worker
- Logger prints an absolute URL for a relative request URL
- Improve GraphQL requests logging
- Verify "setupServer" works with GraphQL request handlers
- "application/json" req.body is not parsed
- Use URL instance in "req.url"
- Worker cannot serialize request headers with multiple values
- Failed to execute 'text' on 'Response': body stream is locked
- Negative lookbehind is not supported in Safari, Firefox
- ENOENT: no such file or directory, copyfile when running "npx msw init"