Skip to content

Commit

Permalink
tooling(test): call req.populate
Browse files Browse the repository at this point in the history
  • Loading branch information
Lordfirespeed committed Aug 11, 2024
1 parent 123b70e commit bdd3cbb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test_helpers/runServer.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { type IncomingMessage, type Server, type ServerResponse, createServer } from 'node:http'
import { type Server, type ServerResponse, createServer } from 'node:http'
import { Request } from '@/packages/app/src'

export const runServer = (func: (req: IncomingMessage, res: ServerResponse) => void | Promise<void>): Server => {
const listener = async (req: IncomingMessage, res: ServerResponse) => {
export const runServer = (func: (req: Request, res: ServerResponse) => void | Promise<void>): Server => {
const listener = async (req: Request, res: ServerResponse) => {
req.populate({ trust: 0, subdomainOffset: undefined })
try {
await func(req, res)
} finally {
Expand Down

0 comments on commit bdd3cbb

Please sign in to comment.