MCPcopy
hub / github.com/jestjs/jest / execMethod

Function execMethod

packages/jest-worker/src/workers/threadChild.ts:180–204  ·  view source on GitHub ↗
(method: string, args: Array<unknown>)

Source from the content-addressed store, hash-verified

178}
179
180function execMethod(method: string, args: Array<unknown>): void {
181 const main = require(file!);
182
183 let fn: UnknownFunction;
184
185 if (method === 'default') {
186 fn = main.__esModule ? main.default : main;
187 } else {
188 fn = main[method];
189 }
190
191 function execHelper() {
192 execFunction(fn, main, args, reportSuccess, reportClientError);
193 }
194
195 if (initialized || !main.setup) {
196 execHelper();
197
198 return;
199 }
200
201 initialized = true;
202
203 execFunction(main.setup, main, setupArgs, execHelper, reportInitializeError);
204}
205
206function execFunction(
207 fn: UnknownFunction,

Callers 1

messageListenerFunction · 0.70

Calls 2

execHelperFunction · 0.70
execFunctionFunction · 0.70

Tested by

no test coverage detected