Skip to content

Commit aef58ca

Browse files
committed
fix(test): use SecureFetchResponse shape in mock instead of standard Response
1 parent 5e3aa18 commit aef58ca

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

apps/sim/tools/index.test.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -487,12 +487,17 @@ describe('Automatic Internal Route Detection', () => {
487487
cleanupEnvVars = setupEnvVars({ NEXT_PUBLIC_APP_URL: 'http://localhost:3000' })
488488

489489
mockValidateUrlWithDNS.mockResolvedValue({ isValid: true, resolvedIP: '93.184.216.34' })
490-
mockSecureFetchWithPinnedIP.mockResolvedValue(
491-
new Response(JSON.stringify({}), {
492-
status: 200,
493-
headers: { 'content-type': 'application/json' },
494-
})
495-
)
490+
mockSecureFetchWithPinnedIP.mockResolvedValue({
491+
ok: true,
492+
status: 200,
493+
statusText: 'OK',
494+
headers: {
495+
get: (name: string) => (name.toLowerCase() === 'content-type' ? 'application/json' : null),
496+
toRecord: () => ({ 'content-type': 'application/json' }),
497+
},
498+
text: async () => JSON.stringify({}),
499+
json: async () => ({}),
500+
})
496501
})
497502

498503
afterEach(() => {

0 commit comments

Comments
 (0)