Skip to content

Commit

Permalink
Update organizationResolvers.test.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
sancheet230 authored Feb 25, 2025
1 parent 46c9477 commit 7c5c8c2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions test/graphql/types/Organization/organizationResolvers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ vi.mock("~/src/graphql/types/Organization/Organization", () => ({
}));

vi.mock("~/src/utilities/TalawaGraphQLError", () => ({
TalawaGraphQLError: class MockError extends Error {},
TalawaGraphQLError: class MockError extends Error {
constructor(options: { extensions: any; message?: string }) {
super(options.message);
this.extensions = options.extensions;
}
},
}));

vi.mock("~/src/drizzleClient", () => ({
Expand All @@ -39,7 +44,10 @@ describe("Organization Resolvers", () => {

test("should handle invalid arguments", () => {
try {
throw new TalawaGraphQLError("Invalid arguments");
throw new TalawaGraphQLError({
extensions: { code: "invalid_arguments", issues: [] },
message: "Invalid arguments",
});
} catch (error) {
expect(error).toBeInstanceOf(TalawaGraphQLError);
}
Expand Down

0 comments on commit 7c5c8c2

Please sign in to comment.