Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added output #60

Merged
merged 21 commits into from
Jun 29, 2023
Merged
Prev Previous commit
Next Next commit
Small test refactoring
  • Loading branch information
pje committed Jun 23, 2021
commit eff4e4ccb3db4fd15d5a621a03ca78fb7c2ffc3a
20 changes: 10 additions & 10 deletions __tests__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,7 @@ describe("run", () => {

usingLabelerConfigYaml("only_pdfs.yml");
mockGitHubResponseChangedFiles("foo.txt");
getPullMock.mockResolvedValue(<any>{
data: {
labels: [{ name: "touched-a-pdf-file" }],
},
});
mockGitHubResponsePreexistingLabels("touched-a-pdf-file");

await run();

Expand All @@ -91,11 +87,7 @@ describe("run", () => {

usingLabelerConfigYaml("only_pdfs.yml");
mockGitHubResponseChangedFiles("foo.txt");
getPullMock.mockResolvedValue(<any>{
data: {
labels: [{ name: "touched-a-pdf-file" }],
},
});
mockGitHubResponsePreexistingLabels("touched-a-pdf-file");

await run();

Expand All @@ -114,3 +106,11 @@ function mockGitHubResponseChangedFiles(...files: string[]): void {
const returnValue = files.map((f) => ({ filename: f }));
paginateMock.mockReturnValue(<any>returnValue);
}

function mockGitHubResponsePreexistingLabels(...labels: string[]): void {
getPullMock.mockResolvedValue(<any>{
data: {
labels: labels.map((label) => ({ name: label })),
},
});
}