-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
88a4139
commit 4eca1cd
Showing
1 changed file
with
10 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,20 @@ | ||
import core from "@actions/core"; | ||
import github from "@actions/github"; | ||
import nock from "nock"; | ||
import type { Octokit } from "@octokit/core"; | ||
import type { Api } from "@octokit/plugin-rest-endpoint-methods/dist-types/types"; | ||
import type { PaginateInterface } from "@octokit/plugin-paginate-rest"; | ||
import type { Api } from "@octokit/plugin-rest-endpoint-methods/dist-types/types"; | ||
import nock from "nock"; | ||
import nodeFetch from "node-fetch"; | ||
|
||
nock.disableNetConnect(); | ||
|
||
type GitHub = Api & Octokit & { paginate: PaginateInterface }; | ||
|
||
jest.mock("../src/octokit", () => { | ||
return { | ||
octokit(): GitHub { | ||
return github.getOctokit(core.getInput("repo-token"), { | ||
request: { | ||
fetch: nodeFetch, | ||
}, | ||
}); | ||
}, | ||
}; | ||
}); | ||
jest.mock("../src/octokit", () => ({ | ||
octokit: (): GitHub => | ||
github.getOctokit(core.getInput("repo-token"), { | ||
request: { | ||
fetch: nodeFetch, | ||
}, | ||
}), | ||
})); |