|
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"; |
3 | 3 | import { EOL } from "os"; |
4 | 4 | import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; |
5 | 5 | import { runner } from "../src/runner.js"; |
@@ -33,8 +33,8 @@ vi.mock("@actions/core", async (importOriginal) => { |
33 | 33 | }; |
34 | 34 | }); |
35 | 35 |
|
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); |
38 | 38 |
|
39 | 39 | describe("nexusphp/no-merge-commits main", () => { |
40 | 40 | beforeEach(() => { |
@@ -89,7 +89,7 @@ describe("nexusphp/no-merge-commits main", () => { |
89 | 89 | }, |
90 | 90 | }, |
91 | 91 | }, |
92 | | - } as unknown as ReturnType<typeof github.getOctokit>); |
| 92 | + } as unknown as ReturnType<typeof getOctokit>); |
93 | 93 |
|
94 | 94 | await expect(runner()).resolves.toBeUndefined(); |
95 | 95 |
|
@@ -138,7 +138,7 @@ describe("nexusphp/no-merge-commits main", () => { |
138 | 138 | }, |
139 | 139 | }, |
140 | 140 | }, |
141 | | - } as unknown as ReturnType<typeof github.getOctokit>); |
| 141 | + } as unknown as ReturnType<typeof getOctokit>); |
142 | 142 |
|
143 | 143 | await expect(runner()).resolves.toBeUndefined(); |
144 | 144 | expect(mockSetFailed).toHaveBeenCalledWith("1 merge commit was found in this pull request."); |
|
0 commit comments