Skip to content
Myr

conninfo.test.ts

This file

Path

src/adapter/vercel/conninfo.test.ts

18 lines · 433 bytes · TypeScript

Last changed by

Not known.

History of this file

Take it

The walk stopped after 200 commits: lines older than f0b094d point at it.

Merge commit from forkYusuke Wadabefore adoptionf0b094d

lines 1–18why, one step back
1import { Context } from '../../context'
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})