(opts)
| 57509 | throw new InvalidArgumentError("responseOptions must be an object"); |
| 57510 | } |
| 57511 | } |
| 57512 | /** |
| 57513 | * Mock an undici request with a defined reply. |
| 57514 | */ |
| 57515 | reply(replyData) { |
| 57516 | if (typeof replyData === "function") { |
| 57517 | const wrappedDefaultsCallback = (opts) => { |
| 57518 | const resolvedData = replyData(opts); |
| 57519 | if (typeof resolvedData !== "object") { |
| 57520 | throw new InvalidArgumentError("reply options callback must return an object"); |
| 57521 | } |
| 57522 | const { statusCode: statusCode2, data: data2 = "", responseOptions: responseOptions2 = {} } = resolvedData; |
| 57523 | this.validateReplyParameters(statusCode2, data2, responseOptions2); |
| 57524 | return { |
nothing calls this directly
no test coverage detected