/
githubmirror
/
trpc
Обзор
Документация
Войти
/
githubmirror
/
trpc
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/tests/server/createClient.test.ts
19 строк
492 B
Alex / KATT
patch: use `globalThis.` over `global.` (#5895)
13 июл 2024, 14:36
Не верифицирован
13 июл 2024, 14:36
f178d3f
Код
Авторство
О чём код?
import { createTRPCClient, httpBatchLink } from '@trpc/client'; globalThis.fetch = vi.fn() as any; describe('typedefs on createClient', () => { test('ok to pass only links', () => { createTRPCClient({ links: [httpBatchLink({ url: 'foo' })], }); }); test('error if both url and links are passed', () => { createTRPCClient({ links: [httpBatchLink({ url: 'foo' })], // @ts-expect-error - can't pass url along with links url: 'foo', }); }); });