Skip to content

Commit 5a4e3d2

Browse files
committed
Import specific functions from actions
1 parent bb88fe2 commit 5a4e3d2

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

__tests__/main.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import * as core from "@actions/core";
2-
import * as github from "@actions/github";
1+
import { setFailed } from "@actions/core";
2+
import { getOctokit } from "@actions/github";
33
import { EOL } from "os";
44
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
55
import { runner } from "../src/runner.js";
@@ -33,8 +33,8 @@ vi.mock("@actions/core", async (importOriginal) => {
3333
};
3434
});
3535

36-
const mockGetOctokit = vi.mocked(github.getOctokit);
37-
const mockSetFailed = vi.mocked(core.setFailed);
36+
const mockGetOctokit = vi.mocked(getOctokit);
37+
const mockSetFailed = vi.mocked(setFailed);
3838

3939
describe("nexusphp/no-merge-commits main", () => {
4040
beforeEach(() => {
@@ -89,7 +89,7 @@ describe("nexusphp/no-merge-commits main", () => {
8989
},
9090
},
9191
},
92-
} as unknown as ReturnType<typeof github.getOctokit>);
92+
} as unknown as ReturnType<typeof getOctokit>);
9393

9494
await expect(runner()).resolves.toBeUndefined();
9595

@@ -138,7 +138,7 @@ describe("nexusphp/no-merge-commits main", () => {
138138
},
139139
},
140140
},
141-
} as unknown as ReturnType<typeof github.getOctokit>);
141+
} as unknown as ReturnType<typeof getOctokit>);
142142

143143
await expect(runner()).resolves.toBeUndefined();
144144
expect(mockSetFailed).toHaveBeenCalledWith("1 merge commit was found in this pull request.");

0 commit comments

Comments
 (0)