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 cc1f5bd commit 67c4dff
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions test/graphql/types/Organization/organizationResolvers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@ import { describe, expect, test, vi } from "vitest";
import "~/src/graphql/types/Organization/organizationResolvers";
import { TalawaGraphQLError } from "~/src/utilities/TalawaGraphQLError";

// Define a proper type for extensions
// Define proper type for issues instead of any[]
interface TalawaGraphQLErrorIssue {
argumentPath: (string | number)[];
message: string;
}

interface TalawaGraphQLErrorExtensions {
code: string;
issues: any[];
issues: TalawaGraphQLErrorIssue[];
}

// Mock dependencies
Expand All @@ -25,7 +30,10 @@ vi.mock("~/src/utilities/TalawaGraphQLError", () => ({
TalawaGraphQLError: class MockError extends Error {
extensions: TalawaGraphQLErrorExtensions;

constructor(options: { extensions: TalawaGraphQLErrorExtensions; message?: string }) {
constructor(options: {
extensions: TalawaGraphQLErrorExtensions;
message?: string;
}) {
super(options.message);
this.extensions = options.extensions;
}
Expand Down

0 comments on commit 67c4dff

Please sign in to comment.