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 3
3
import Hook from "require-in-the-middle" ;
4
4
import { Headers , ResponseInit } from "node-fetch" ;
5
5
import mixin from "merge-descriptors" ;
6
- import { getExecutionContext } from "../../src/context" ;
6
+ import { createExecutionContext , getExecutionContext } from "../../src/context" ;
7
7
import { Readable } from "stream" ;
8
8
import { ProcessDep , stringToBinary } from "../../src/util" ;
9
9
import { putMocks } from "../../mock/utils" ;
@@ -12,6 +12,7 @@ import { getRequestHeader, getResponseHeader } from "../express/middleware";
12
12
import { getReasonPhrase } from "http-status-codes" ;
13
13
import { DataBytes } from "../../proto/services/DataBytes" ;
14
14
import { MockIds } from "../../mock/mock" ;
15
+ import { MODE_OFF } from "../../src/mode" ;
15
16
16
17
// @ts -ignore
17
18
Hook ( [ "node-fetch" ] , function ( exported ) {
@@ -37,6 +38,9 @@ export function wrappedNodeFetch(fetch: any) {
37
38
url : any ,
38
39
options : any
39
40
) {
41
+ if ( process . env . KEPLOY_MODE == MODE_OFF ) {
42
+ createExecutionContext ( { mode : MODE_OFF } ) ;
43
+ }
40
44
if (
41
45
getExecutionContext ( ) == undefined ||
42
46
getExecutionContext ( ) . context == undefined
You can’t perform that action at this time.
0 commit comments