conninfo.test.ts
This file
Path
adapters/vercel/src/conninfo.test.ts
18 lines · 424 bytes · TypeScript
Last changed by
feat(adapters): add the seven adapters as workspace packages (#5463)Yusuke Wadabefore adoptionb877827
History of this fileTake it
feat(adapters): add the seven adapters as workspace packages (#5463)Yusuke Wadabefore adoptionb877827
lines 1–18why, one step back1import { Context } from 'hono'2import { getConnInfo } from './conninfo'34describe('getConnInfo', () => {5 it('Should getConnInfo works', () => {6 const address = Math.random().toString()7 const req = new Request('http://localhost/', {8 headers: {9 'x-real-ip': address,10 },11 })12 const c = new Context(req)1314 const info = getConnInfo(c)1516 expect(info.remote.address).toBe(address)17 })18})