Skip to content

Commit

Permalink
fix: moch remoteFileExists axios call
Browse files Browse the repository at this point in the history
  • Loading branch information
KoiFresh committed Jan 17, 2025
1 parent 4db37c6 commit e8e4b85
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/test-cases/include-component/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand 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({
Expand Down

0 comments on commit e8e4b85

Please sign in to comment.