import { type IWorldOptions, World, setWorldConstructor } from "@cucumber/cucumber"; import type { Express } from "express"; import type request from "supertest"; import { createApp } from "../../src/app.js"; // Fresh Express app per scenario (in-process, via supertest — no server to // spin up/tear down) plus the last HTTP response, available to every step. export class CustomWorld extends World { app: Express; response!: request.Response; constructor(options: IWorldOptions) { super(options); this.app = createApp(); } } setWorldConstructor(CustomWorld);