Skip to content

Commit e8e4b85

Browse files
committed
fix: moch remoteFileExists axios call
1 parent 4db37c6 commit e8e4b85

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/test-cases/include-component/integration.test.ts

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import {handler} from "../../../src/handler.js";
33
import assert, {AssertionError} from "assert";
44
import {initSpawnSpy} from "../../mocks/utils.mock.js";
55
import {WhenStatics} from "../../mocks/when-statics.js";
6+
import {Utils} from "../../../src/utils.js";
7+
import {when} from "jest-when";
68

79
beforeAll(() => {
810
initSpawnSpy(WhenStatics.all);
@@ -26,6 +28,8 @@ test.concurrent("include-component no component template file (protocol: https)"
2628

2729
test.concurrent("include-component component (protocol: https)", async () => {
2830
initSpawnSpy([WhenStatics.mockGitRemoteHttp]);
31+
const remoteFileExistSpy = import.meta.jest.spyOn(Utils, "remoteFileExist");
32+
when(remoteFileExistSpy).calledWith(expect.anything(), "templates/full-pipeline.yml", "0.3.1", "gitlab.com", "components/go", "https", "443").mockResolvedValue(true);
2933

3034
const writeStreams = new WriteStreamsMock();
3135
await handler({

0 commit comments

Comments
 (0)