(method: string, args: Array<unknown>)
| 178 | } |
| 179 | |
| 180 | function 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 | |
| 206 | function execFunction( |
| 207 | fn: UnknownFunction, |
no test coverage detected