Comparing version 2.4.3 to 2.4.4
@@ -11,3 +11,3 @@ /* eslint-disable */ | ||
const PACKAGE_VERSION = '2.4.3' | ||
const PACKAGE_VERSION = '2.4.4' | ||
const INTEGRITY_CHECKSUM = '26357c79639bfa20d64c0efca2a87423' | ||
@@ -14,0 +14,0 @@ const IS_MOCKED_RESPONSE = Symbol('isMockedResponse') |
@@ -55,15 +55,18 @@ "use strict"; | ||
init() { | ||
this.interceptor.on("request", async ({ request, requestId }) => { | ||
const response = await (0, import_handleRequest.handleRequest)( | ||
request, | ||
requestId, | ||
this.handlersController.currentHandlers(), | ||
this.resolvedOptions, | ||
this.emitter | ||
); | ||
if (response) { | ||
request.respondWith(response); | ||
this.interceptor.on( | ||
"request", | ||
async ({ request, requestId, controller }) => { | ||
const response = await (0, import_handleRequest.handleRequest)( | ||
request, | ||
requestId, | ||
this.handlersController.currentHandlers(), | ||
this.resolvedOptions, | ||
this.emitter | ||
); | ||
if (response) { | ||
controller.respondWith(response); | ||
} | ||
return; | ||
} | ||
return; | ||
}); | ||
); | ||
this.interceptor.on("unhandledException", ({ error }) => { | ||
@@ -70,0 +73,0 @@ if (error instanceof import_devUtils.InternalError) { |
@@ -60,15 +60,18 @@ "use strict"; | ||
init() { | ||
this.interceptor.on("request", async ({ request, requestId }) => { | ||
const response = await (0, import_handleRequest.handleRequest)( | ||
request, | ||
requestId, | ||
this.handlersController.currentHandlers(), | ||
this.resolvedOptions, | ||
this.emitter | ||
); | ||
if (response) { | ||
request.respondWith(response); | ||
this.interceptor.on( | ||
"request", | ||
async ({ request, requestId, controller }) => { | ||
const response = await (0, import_handleRequest.handleRequest)( | ||
request, | ||
requestId, | ||
this.handlersController.currentHandlers(), | ||
this.resolvedOptions, | ||
this.emitter | ||
); | ||
if (response) { | ||
controller.respondWith(response); | ||
} | ||
return; | ||
} | ||
return; | ||
}); | ||
); | ||
this.interceptor.on("unhandledException", ({ error }) => { | ||
@@ -75,0 +78,0 @@ if (error instanceof import_devUtils.InternalError) { |
{ | ||
"name": "msw", | ||
"version": "2.4.3", | ||
"version": "2.4.4", | ||
"description": "Seamless REST/GraphQL API mocking library for browser and Node.js.", | ||
@@ -120,3 +120,3 @@ "main": "./lib/core/index.js", | ||
"@inquirer/confirm": "^3.0.0", | ||
"@mswjs/interceptors": "^0.29.0", | ||
"@mswjs/interceptors": "^0.35.0", | ||
"@open-draft/until": "^2.1.0", | ||
@@ -123,0 +123,0 @@ "@types/cookie": "^0.6.0", |
@@ -21,3 +21,3 @@ import { | ||
interceptor.on('request', async ({ request, requestId }) => { | ||
interceptor.on('request', async ({ request, requestId, controller }) => { | ||
const requestCloneForLogs = request.clone() | ||
@@ -47,3 +47,3 @@ | ||
if (response) { | ||
request.respondWith(response) | ||
controller.respondWith(response) | ||
} | ||
@@ -50,0 +50,0 @@ }) |
@@ -55,17 +55,20 @@ /** | ||
private init(): void { | ||
this.interceptor.on('request', async ({ request, requestId }) => { | ||
const response = await handleRequest( | ||
request, | ||
requestId, | ||
this.handlersController.currentHandlers(), | ||
this.resolvedOptions, | ||
this.emitter, | ||
) | ||
this.interceptor.on( | ||
'request', | ||
async ({ request, requestId, controller }) => { | ||
const response = await handleRequest( | ||
request, | ||
requestId, | ||
this.handlersController.currentHandlers(), | ||
this.resolvedOptions, | ||
this.emitter, | ||
) | ||
if (response) { | ||
request.respondWith(response) | ||
} | ||
if (response) { | ||
controller.respondWith(response) | ||
} | ||
return | ||
}) | ||
return | ||
}, | ||
) | ||
@@ -72,0 +75,0 @@ this.interceptor.on('unhandledException', ({ error }) => { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4060249
50280
6
+ Added@mswjs/interceptors@0.35.6(transitive)
- Removed@mswjs/interceptors@0.29.1(transitive)
Updated@mswjs/interceptors@^0.35.0