From 6a76b893722bd9738a4360d61a622967f662ad1a Mon Sep 17 00:00:00 2001 From: Brian Fletcher Date: Thu, 3 Aug 2023 14:13:53 +0100 Subject: [PATCH] fix mocking Signed-off-by: Brian Fletcher --- .../actions/builtin/fetch/plainFile.examples.test.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/fetch/plainFile.examples.test.ts b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/fetch/plainFile.examples.test.ts index 86fe15be8e..2ee17c29fe 100644 --- a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/fetch/plainFile.examples.test.ts +++ b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/fetch/plainFile.examples.test.ts @@ -14,6 +14,11 @@ * limitations under the License. */ +jest.mock('@backstage/plugin-scaffolder-node', () => { + const actual = jest.requireActual('@backstage/plugin-scaffolder-node'); + return { ...actual, fetchFile: jest.fn() }; +}); + import yaml from 'yaml'; import os from 'os'; import { resolve as resolvePath } from 'path'; @@ -25,11 +30,6 @@ import { PassThrough } from 'stream'; import { fetchFile } from '@backstage/plugin-scaffolder-node'; import { examples } from './plainFile.examples'; -jest.mock('@backstage/plugin-scaffolder-node', () => ({ - ...jest.requireActual('@backstage/plugin-scaffolder-node'), - fetchContents: jest.fn(), -})); - describe('fetch:plain:file examples', () => { const integrations = ScmIntegrations.fromConfig( new ConfigReader({