(proxy)
| 565 | // closure with opts.upstreamMode rather than env, mirroring how the |
| 566 | // closure is actually called in production. |
| 567 | function makeDispatch(proxy) { |
| 568 | return (reqPath, body, opts) => { |
| 569 | const mode = opts?.upstreamMode || 'anthropic'; |
| 570 | return mode === 'bedrock' |
| 571 | ? proxy._proxyBedrock(reqPath, body, opts) |
| 572 | : proxy._proxyAnthropic(reqPath, body, opts); |
| 573 | }; |
| 574 | } |
| 575 | |
| 576 | it('opts.upstreamMode unset → _proxyAnthropic', async () => { |
| 577 | const proxy = new EvoMapProxy({ logger: { log: () => {}, error: () => {}, warn: () => {} } }); |
no test coverage detected