Skip to content

Commit cf34f3c

Browse files
KhafraDevronag
authored andcommitted
fix: rename to isMockActive
1 parent e0d32ca commit cf34f3c

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lib/fetch/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1911,7 +1911,7 @@ async function httpNetworkFetch (
19111911
path: url.pathname + url.search,
19121912
origin: url.origin,
19131913
method: request.method,
1914-
body: fetchParams.controller.dispatcher.isActive ? request.body && request.body.source : body,
1914+
body: fetchParams.controller.dispatcher.isMockActive ? request.body && request.body.source : body,
19151915
headers: [...request.headersList].flat(),
19161916
maxRedirections: 0,
19171917
bodyTimeout: 300_000,

lib/mock/mock-agent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class MockAgent extends Dispatcher {
9898

9999
// This is required to bypass issues caused by using global symbols - see:
100100
// https://github.com/nodejs/undici/issues/1447
101-
get isActive () {
101+
get isMockActive () {
102102
return this[kIsMockActive]
103103
}
104104

lib/mock/mock-utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ function buildMockDispatch () {
301301
const originalDispatch = this[kOriginalDispatch]
302302

303303
return function dispatch (opts, handler) {
304-
if (agent.isActive) {
304+
if (agent.isMockActive) {
305305
try {
306306
mockDispatch.call(this, opts, handler)
307307
} catch (error) {

0 commit comments

Comments
 (0)