From 55853a36717439f64d8c7d78f8823dd7a39d06d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Thu, 15 Jun 2023 15:12:09 +0200 Subject: [PATCH] test apps should have a fetch api by default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .changeset/plenty-weeks-boil.md | 5 +++++ packages/test-utils/src/testUtils/mockApis.ts | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 .changeset/plenty-weeks-boil.md diff --git a/.changeset/plenty-weeks-boil.md b/.changeset/plenty-weeks-boil.md new file mode 100644 index 0000000000..a26abf06eb --- /dev/null +++ b/.changeset/plenty-weeks-boil.md @@ -0,0 +1,5 @@ +--- +'@backstage/test-utils': patch +--- + +Add a `fetchApiRef` implementation by default diff --git a/packages/test-utils/src/testUtils/mockApis.ts b/packages/test-utils/src/testUtils/mockApis.ts index 99260d80f9..0fbfdf5967 100644 --- a/packages/test-utils/src/testUtils/mockApis.ts +++ b/packages/test-utils/src/testUtils/mockApis.ts @@ -15,13 +15,15 @@ */ import { - storageApiRef, - errorApiRef, createApiFactory, + errorApiRef, + fetchApiRef, + storageApiRef, } from '@backstage/core-plugin-api'; -import { MockErrorApi, MockStorageApi } from './apis'; +import { MockErrorApi, MockFetchApi, MockStorageApi } from './apis'; export const mockApis = [ createApiFactory(errorApiRef, new MockErrorApi()), + createApiFactory(fetchApiRef, new MockFetchApi()), createApiFactory(storageApiRef, MockStorageApi.create()), ];