playwright-msw
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -5,2 +5,11 @@ # Changelog | ||
## [1.0.2](https://github.com/valendres/playwright-msw/compare/playwright-msw@1.0.1...playwright-msw@1.0.2) "playwright-msw" (2022-10-04)<a name="1.0.2"></a> | ||
### Bug Fixes | ||
* improve compatibility with older versions of msw (#21) ([daa4e96](https://github.com/valendres/playwright-msw/commits/daa4e96)) | ||
## [1.0.1](https://github.com/valendres/playwright-msw/compare/playwright-msw@1.0.0...playwright-msw@1.0.1) "playwright-msw" (2022-10-04)<a name="1.0.1"></a> | ||
@@ -7,0 +16,0 @@ |
@@ -31,2 +31,11 @@ "use strict"; | ||
}); | ||
const handleMockResponse = ({ status, headers, body }) => { | ||
var _a; | ||
route.fulfill({ | ||
status, | ||
body: body !== null && body !== void 0 ? body : undefined, | ||
contentType: (_a = headers.get("content-type")) !== null && _a !== void 0 ? _a : undefined, | ||
headers: headers.all(), | ||
}); | ||
}; | ||
yield (0, msw_1.handleRequest)(mockedRequest, handlers, { | ||
@@ -40,12 +49,4 @@ onUnhandledRequest: () => { | ||
}, | ||
onMockedResponse(mockedResponse) { | ||
var _a; | ||
const { status, headers, body } = mockedResponse; | ||
route.fulfill({ | ||
status, | ||
body: body !== null && body !== void 0 ? body : undefined, | ||
contentType: (_a = headers.get("content-type")) !== null && _a !== void 0 ? _a : undefined, | ||
headers: headers.all(), | ||
}); | ||
}, | ||
onMockedResponse: handleMockResponse, | ||
onMockedResponseSent: handleMockResponse, | ||
}); | ||
@@ -52,0 +53,0 @@ }); |
{ | ||
"name": "playwright-msw", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "A Mock Service Worker API for Playwright.", | ||
@@ -28,3 +28,3 @@ "main": "lib/index.js", | ||
"@playwright/test": ">=1.20.0", | ||
"msw": ">=0.47.3" | ||
"msw": ">=0.44.0" | ||
}, | ||
@@ -31,0 +31,0 @@ "devDependencies": { |
16544
142