Skip to content

Commit

Permalink
export createMockSchema and proxiedSchema
Browse files Browse the repository at this point in the history
  • Loading branch information
alessbell committed Mar 20, 2024
1 parent 88c3f4f commit ea891f2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/__tests__/__snapshots__/exports.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -369,9 +369,11 @@ Array [
"MockSubscriptionLink",
"MockedProvider",
"createMockClient",
"createMockSchema",
"itAsync",
"mockObservableLink",
"mockSingleLink",
"proxiedSchema",
"subscribeAndCount",
"tick",
"wait",
Expand All @@ -389,6 +391,7 @@ Array [
"itAsync",
"mockObservableLink",
"mockSingleLink",
"proxiedSchema",
"subscribeAndCount",
"tick",
"wait",
Expand Down
1 change: 1 addition & 0 deletions src/testing/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ export { createMockClient } from "./mocking/mockClient.js";
export { default as subscribeAndCount } from "./subscribeAndCount.js";
export { itAsync } from "./itAsync.js";
export { wait, tick } from "./wait.js";
export { proxiedSchema } from "./schemaProxy.js";
export * from "./withConsoleSpy.js";
2 changes: 2 additions & 0 deletions src/testing/core/schemaProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ const proxiedSchema = (
},
}));
}
// @ts-expect-error
if (typeof targetSchema[p] === "function") {
// @ts-expect-error
return targetSchema[p].bind(targetSchema);
}
return Reflect.get(target, p);
Expand Down
1 change: 1 addition & 0 deletions src/testing/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ import "../utilities/globals/index.js";
export type { MockedProviderProps } from "./react/MockedProvider.js";
export { MockedProvider } from "./react/MockedProvider.js";
export * from "./core/index.js";
export { createMockSchema } from "./graphql-tools/utils.js";

0 comments on commit ea891f2

Please sign in to comment.