Skip to content

Commit cfb67ca

Browse files
committed
OLH-755: removed test-utils as it was unnecessary with vitest
1 parent b24a380 commit cfb67ca

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

src/components/change-email/tests/change-email-integration.test.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
import request from "supertest";
2-
import { describe, beforeAll, afterAll, it, vi, beforeEach } from "vitest";
3-
import { expect } from "../../../../test/utils/test-utils.js";
2+
import {
3+
describe,
4+
beforeAll,
5+
afterAll,
6+
it,
7+
expect,
8+
vi,
9+
beforeEach,
10+
} from "vitest";
411
import { testComponent } from "../../../../test/utils/helpers.js";
512
import nock = require("nock");
613
import * as cheerio from "cheerio";
@@ -29,7 +36,7 @@ describe("Integration:: change email", () => {
2936
"../../../middleware/requires-auth-middleware.js"
3037
);
3138
vi.spyOn(sessionMiddleware, "requiresAuthMiddleware").mockImplementation(
32-
function (req: any, res: any, next: any): void {
39+
async function (req: any, res: any, next: any): Promise<void> {
3340
req.session.user = {
3441
email: "test@test.com",
3542
phoneNumber: "07839490040",

test/utils/behaviours.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Application } from "express";
22
import request from "supertest";
3-
import { expect } from "./test-utils.js";
3+
import { expect } from "vitest";
44

55
export async function checkFailedCSRFValidationBehaviour(
66
app: Application,
@@ -12,5 +12,5 @@ export async function checkFailedCSRFValidationBehaviour(
1212
.type("form")
1313
.send(payload)
1414
.expect(302);
15-
expect(response.header.location).to.equal("/your-services");
15+
expect(response.header.location).toBe("/your-services");
1616
}

test/utils/test-utils.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)