Skip to content

Commit 91df75a

Browse files
committed
mock something
1 parent 970e49c commit 91df75a

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

tests/unit/mobileWallet.test.ts

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,8 @@ const sesMock = mockClient(SESClient);
1010
const jwt_secret = secretObject["jwt_key"];
1111
vi.stubEnv("JwtSigningKey", jwt_secret);
1212

13-
vi.mock("fs", () => {
14-
return {
15-
...vi.importActual("fs"),
16-
promises: {
17-
readFile: vi.fn(() => {
18-
return "";
19-
}),
20-
},
21-
};
22-
});
23-
2413
vi.mock("../../src/api/functions/membership.js", () => {
2514
return {
26-
...vi.importActual("../../src/api/functions/membership.js"),
2715
checkPaidMembership: vi.fn(
2816
(_endpoint: string, _log: any, netId: string) => {
2917
if (netId === "valid") {
@@ -37,7 +25,6 @@ vi.mock("../../src/api/functions/membership.js", () => {
3725

3826
vi.mock("../../src/api/functions/entraId.js", () => {
3927
return {
40-
...vi.importActual("../../src/api/functions/entraId.js"),
4128
getEntraIdToken: vi.fn().mockImplementation(async () => {
4229
return "atokenofalltime";
4330
}),
@@ -58,6 +45,14 @@ vi.mock("../../src/api/functions/entraId.js", () => {
5845
};
5946
});
6047

48+
vi.mock("../../src/api/functions/mobileWallet.js", () => {
49+
return {
50+
issueAppleWalletMembershipCard: vi.fn().mockImplementation(async () => {
51+
return new ArrayBuffer();
52+
}),
53+
};
54+
});
55+
6156
const app = await init();
6257
describe("Mobile wallet pass issuance", async () => {
6358
test("Test that passes will not be issued for non-emails", async () => {
@@ -83,6 +78,7 @@ describe("Mobile wallet pass issuance", async () => {
8378
url: "/api/v1/mobileWallet/[email protected]",
8479
});
8580
expect(response.statusCode).toBe(202);
81+
expect();
8682
});
8783
test("Test that SES errors result in a server error", async () => {
8884
sesMock.on(SendRawEmailCommand).rejects({});

0 commit comments

Comments
 (0)