Skip to content

Supertest link for tRPC - Write tests for your tRPC + express API

License

Notifications You must be signed in to change notification settings

Carnewal/trpc-supertest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

trpc-supertest

[WIP] A trpc link for supertest requests

Usage

import { createTRPCClient } from '@trpc/client'
import { supertestLink } from "@carnewal/trpc-supertest" // Package does not exist on NPM yet.
import { AppRouter } from './trpc'
import express from 'express'

const app = express()

const trpcTestClient = createTRPCClient<AppRouter>({
    links: [supertestLink(app, { trpcPath: '/api/v1/trpc', headers: { Authorization: 'Bearer token' } })],
})

// await trpcTestClient.query.[...]

About

Supertest link for tRPC - Write tests for your tRPC + express API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published