File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 33import Hook from "require-in-the-middle" ;
44import { Headers , ResponseInit } from "node-fetch" ;
55import mixin from "merge-descriptors" ;
6- import { getExecutionContext } from "../../src/context" ;
6+ import { createExecutionContext , getExecutionContext } from "../../src/context" ;
77import { Readable } from "stream" ;
88import { ProcessDep , stringToBinary } from "../../src/util" ;
99import { putMocks } from "../../mock/utils" ;
@@ -12,6 +12,7 @@ import { getRequestHeader, getResponseHeader } from "../express/middleware";
1212import { getReasonPhrase } from "http-status-codes" ;
1313import { DataBytes } from "../../proto/services/DataBytes" ;
1414import { MockIds } from "../../mock/mock" ;
15+ import { MODE_OFF } from "../../src/mode" ;
1516
1617// @ts -ignore
1718Hook ( [ "node-fetch" ] , function ( exported ) {
@@ -37,6 +38,9 @@ export function wrappedNodeFetch(fetch: any) {
3738 url : any ,
3839 options : any
3940 ) {
41+ if ( process . env . KEPLOY_MODE == MODE_OFF ) {
42+ createExecutionContext ( { mode : MODE_OFF } ) ;
43+ }
4044 if (
4145 getExecutionContext ( ) == undefined ||
4246 getExecutionContext ( ) . context == undefined
You can’t perform that action at this time.
0 commit comments