Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions src/test-helpers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { JSONSchema } from "@json-schema-tools/meta-schema";

export const testCalls = (
mockMutation: any,

Check warning on line 4 in src/test-helpers.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
schema: JSONSchema,
isCycle: any = expect.any(Boolean),

Check warning on line 6 in src/test-helpers.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
nth?: number,
parent: any = expect.anything(),

Check warning on line 8 in src/test-helpers.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
) => {
if (parent === false) { parent = undefined; }
if (nth) {
expect(mockMutation).toHaveBeenNthCalledWith(
nth,
schema,
isCycle,
expect.any(String),
parent
);
} else {
expect(mockMutation).toHaveBeenCalledWith(
schema,
isCycle,
expect.any(String),
parent
);
}
};
Loading
Loading