async function beforeEach(
  ctx,
  agentConfig = defaultAgentConfig,
  validator = () => assert.ok(true)
) {
  ctx.agent = helper.instrumentMockedAgent(agentConfig)
  ctx.http = require('node:http')

  const { server, host, port } = await createServer(ctx.http, ctx.agent, validator)
  ctx.server = server
  ctx.host = host
  ctx.port = port
}
@param {object} ctx The `t.nr` object that we use as local test context.
@param {object} agentConfig The agent configuration to use for the test.
@param {function} validator
@returns {Promise<void>}