diff --git a/cypress/e2e/smoke.cy.ts b/cypress/e2e/smoke.cy.ts index f62a86ee..4b0d9e5a 100644 --- a/cypress/e2e/smoke.cy.ts +++ b/cypress/e2e/smoke.cy.ts @@ -11,7 +11,7 @@ describe("smoke tests", () => { password: faker.internet.password(), }; - cy.then(() => ({ email: loginForm.email })).as("user"); + cy.then<{ email: string }>(() => ({ email: loginForm.email })).as("user"); cy.visitAndCheck("/"); diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index 0865e4e1..b41ec0b3 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -47,7 +47,7 @@ function login({ }: { email?: string; } = {}) { - cy.then(() => ({ email })).as("user"); + cy.then<{ email: string }>(() => ({ email })).as("user"); cy.exec( `npx ts-node --require tsconfig-paths/register ./cypress/support/create-user.ts "${email}"`, ).then(({ stdout }) => { @@ -56,15 +56,14 @@ function login({ .trim(); cy.setCookie("__session", cookieValue); }); - return cy.get("@user"); + return cy.get<{ email?: string }>("@user"); } function cleanupUser({ email }: { email?: string } = {}) { if (email) { deleteUserByEmail(email); } else { - cy.get("@user").then((user) => { - const email = (user as { email?: string }).email; + cy.get<{ email?: string }>("@user").then(({ email }) => { if (email) { deleteUserByEmail(email); }