From 6ad7fe57ed95554960765d978c4747f5f15fd6a8 Mon Sep 17 00:00:00 2001 From: Martijn Walraven Date: Tue, 2 Mar 2021 08:08:43 +0100 Subject: [PATCH] Import matchers from subdirectory instead of root I'd love to replace the import from `dist/matchers` with a plain `matchers` by using the `exports` field in `package.json`. Unfortunately, neither Jest nor TypeScript currently support this. --- federation-integration-testsuite-js/src/index.ts | 1 - federation-js/src/__tests__/testSetup.ts | 2 +- gateway-js/src/__tests__/testSetup.ts | 2 +- query-planner-js/src/__tests__/testSetup.ts | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/federation-integration-testsuite-js/src/index.ts b/federation-integration-testsuite-js/src/index.ts index bf079c679..efcca38f1 100644 --- a/federation-integration-testsuite-js/src/index.ts +++ b/federation-integration-testsuite-js/src/index.ts @@ -1,3 +1,2 @@ -export * from './matchers'; export * from './snapshotSerializers'; export * from './fixtures'; diff --git a/federation-js/src/__tests__/testSetup.ts b/federation-js/src/__tests__/testSetup.ts index afb18fd76..e1cb4406b 100644 --- a/federation-js/src/__tests__/testSetup.ts +++ b/federation-js/src/__tests__/testSetup.ts @@ -1 +1 @@ -import 'apollo-federation-integration-testsuite'; +import 'apollo-federation-integration-testsuite/dist/matchers'; diff --git a/gateway-js/src/__tests__/testSetup.ts b/gateway-js/src/__tests__/testSetup.ts index afb18fd76..e1cb4406b 100644 --- a/gateway-js/src/__tests__/testSetup.ts +++ b/gateway-js/src/__tests__/testSetup.ts @@ -1 +1 @@ -import 'apollo-federation-integration-testsuite'; +import 'apollo-federation-integration-testsuite/dist/matchers'; diff --git a/query-planner-js/src/__tests__/testSetup.ts b/query-planner-js/src/__tests__/testSetup.ts index afb18fd76..e1cb4406b 100644 --- a/query-planner-js/src/__tests__/testSetup.ts +++ b/query-planner-js/src/__tests__/testSetup.ts @@ -1 +1 @@ -import 'apollo-federation-integration-testsuite'; +import 'apollo-federation-integration-testsuite/dist/matchers';