From e8e4b85abfcd4386d8d8be8d9e83c1a6545b0c50 Mon Sep 17 00:00:00 2001 From: Kai Mayer Date: Fri, 17 Jan 2025 17:24:15 +0000 Subject: [PATCH] fix: moch remoteFileExists axios call --- tests/test-cases/include-component/integration.test.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test-cases/include-component/integration.test.ts b/tests/test-cases/include-component/integration.test.ts index 9c0bcf16..748af104 100644 --- a/tests/test-cases/include-component/integration.test.ts +++ b/tests/test-cases/include-component/integration.test.ts @@ -3,6 +3,8 @@ import {handler} from "../../../src/handler.js"; import assert, {AssertionError} from "assert"; import {initSpawnSpy} from "../../mocks/utils.mock.js"; import {WhenStatics} from "../../mocks/when-statics.js"; +import {Utils} from "../../../src/utils.js"; +import {when} from "jest-when"; beforeAll(() => { initSpawnSpy(WhenStatics.all); @@ -26,6 +28,8 @@ test.concurrent("include-component no component template file (protocol: https)" test.concurrent("include-component component (protocol: https)", async () => { initSpawnSpy([WhenStatics.mockGitRemoteHttp]); + const remoteFileExistSpy = import.meta.jest.spyOn(Utils, "remoteFileExist"); + when(remoteFileExistSpy).calledWith(expect.anything(), "templates/full-pipeline.yml", "0.3.1", "gitlab.com", "components/go", "https", "443").mockResolvedValue(true); const writeStreams = new WriteStreamsMock(); await handler({