From 00d80d726aa1f1839a815995867689bcadf08610 Mon Sep 17 00:00:00 2001 From: Tim Leslie Date: Wed, 28 Jul 2021 12:53:34 +1000 Subject: [PATCH] Suppress logging during tests (#6207) --- .changeset/khaki-ducks-poke.md | 5 +++++ packages/fields-document/src/relationship-data.tsx | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 .changeset/khaki-ducks-poke.md diff --git a/.changeset/khaki-ducks-poke.md b/.changeset/khaki-ducks-poke.md new file mode 100644 index 00000000000..4f3a5c1675a --- /dev/null +++ b/.changeset/khaki-ducks-poke.md @@ -0,0 +1,5 @@ +--- +'@keystone-next/fields-document': patch +--- + +Suppressed error logging during tests. diff --git a/packages/fields-document/src/relationship-data.tsx b/packages/fields-document/src/relationship-data.tsx index 34d780b6577..553ab970fab 100644 --- a/packages/fields-document/src/relationship-data.tsx +++ b/packages/fields-document/src/relationship-data.tsx @@ -60,8 +60,10 @@ export function addRelationshipData( // If we're unable to find the item (e.g. we have a dangling reference), or access was denied // then simply return { id } and leave `label` and `data` undefined. const r = JSON.stringify(relationship); - console.error(`Unable to fetch relationship data: relationship: ${r}, id: ${id} `); - console.error(err); + if (!process.env.TEST_ADAPTER) { + console.error(`Unable to fetch relationship data: relationship: ${r}, id: ${id} `); + console.error(err); + } return { id }; } else { // Other types of errors indicate something wrong with either the system or the