import assert from "node:assert/strict"; import { Then, When } from "@cucumber/cucumber"; import type { CustomWorld } from "../support/world.js"; When("I request my preferences", async function (this: CustomWorld) { this.response = await this.agent.get("/preferences"); }); When("I set my theme preference to {string}", async function (this: CustomWorld, theme: string) { this.response = await this.agent.patch("/preferences").send({ theme }); }); Then("my theme preference should be {string}", function (this: CustomWorld, theme: string) { assert.equal(this.response.body.theme, theme); });