/
githubmirror
/
trpc
Обзор
Документация
Войти
/
githubmirror
/
trpc
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/tests/server/callRouter.test.ts
22 строки
471 B
Anatol Zakrividoroga
feat(server): add `batchIndex` to procedures and middleware in batched requests (#7097)
04 фев 2026, 17:39
Не верифицирован
04 фев 2026, 17:39
bc215fe
Код
Авторство
О чём код?
import { initTRPC } from '@trpc/server'; // FIXME: should we deprecate this? test('call proc directly', async () => { const t = initTRPC.create(); const router = t.router({ sub: t.router({ hello: t.procedure.query(() => 'hello'), }), }); const result = await router.sub.hello({ ctx: {}, path: 'asd', type: 'query', getRawInput: async () => ({}), signal: undefined, batchIndex: 0, }); expect(result).toBe('hello'); });