Skip to content
Myr

conninfo.test.ts

This file

Path

src/adapter/lambda-edge/conninfo.test.ts

27 lines · 635 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–27why, one step back
1import { Context } from '../../context'
2import { getConnInfo } from './conninfo'3import type { CloudFrontEdgeEvent } from './handler'45describe('getConnInfo', () => {6 it('Should info is valid', () => {7 const clientIp = Math.random().toString()8 const env = {9 event: {10 Records: [11 {12 cf: {13 request: {14 clientIp,15 },16 },17 },18 ],19 } as CloudFrontEdgeEvent,20 }2122 const c = new Context(new Request('http://localhost/'), { env })23 const info = getConnInfo(c)2425 expect(info.remote.address).toBe(clientIp)26 })27})