aboutsummaryrefslogtreecommitdiffstats
path: root/tests/msw/instances/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'tests/msw/instances/index.ts')
-rw-r--r--tests/msw/instances/index.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/msw/instances/index.ts b/tests/msw/instances/index.ts
new file mode 100644
index 0000000..82218c3
--- /dev/null
+++ b/tests/msw/instances/index.ts
@@ -0,0 +1,10 @@
+import { graphql } from 'msw';
+import { GITHUB_API } from '../../../src/utils/constants';
+
+const wordpressGraphQLUrl = process.env.NEXT_PUBLIC_STAGING_GRAPHQL_API;
+
+if (!wordpressGraphQLUrl)
+ throw new Error('You forgot to define an URL for the WordPress GraphQL API');
+
+export const githubAPI = graphql.link(GITHUB_API);
+export const wordpressAPI = graphql.link(wordpressGraphQLUrl);