Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

document mount extending to include options and context #2609

Closed
wants to merge 1 commit into from
Closed
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
13 changes: 11 additions & 2 deletions packages/react-testing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,23 @@ import {createMount} from '@shopify/react-testing';

interface Options {
pathname: string;
beta: boolean
}

interface ExtendedOptions {
graphQLResult: object;
}

const mount = createMount<Options, Options>({
context: (options) => options,
const mount = createMount<Options, Context>({
context: (options) => {
const context: Content = {
pathname,
grahpQL: createGraphQL({
BetaFlags: {enabled: options.beta},
}),
}
return contenxt;
},
render: (element, {pathname}) => (
<Router pathname={pathname}>{element}</Router>
),
Expand Down