( fn: string, response: McpResponse, context: McpContext, args: ParsedArguments, )
| 82 | } |
| 83 | |
| 84 | async function evaluate( |
| 85 | fn: string, |
| 86 | response: McpResponse, |
| 87 | context: McpContext, |
| 88 | args: ParsedArguments, |
| 89 | ): Promise<unknown> { |
| 90 | response.resetResponseLineForTesting(); |
| 91 | await evaluateScript(args).handler( |
| 92 | {params: {function: fn}}, |
| 93 | response, |
| 94 | context, |
| 95 | ); |
| 96 | const line = response.responseLines.at(2); |
| 97 | assert.ok(line, `unexpected response: ${response.responseLines.join('\n')}`); |
| 98 | return line === 'undefined' ? undefined : JSON.parse(line); |
| 99 | } |
| 100 | |
| 101 | /** |
| 102 | * Fetches `url` from the selected page and returns the outcome. The timeout |
no test coverage detected