Skip to content

Commit

Permalink
update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
andrefcdias authored Oct 3, 2022
1 parent c091a87 commit 2bced0e
Show file tree
Hide file tree
Showing 4 changed files with 663 additions and 477 deletions.
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,26 @@
"author": "andrefcdias",
"license": "MIT",
"dependencies": {
"@actions/core": "1.9.1",
"@actions/github": "5.0.3",
"@actions/core": "1.10.0",
"@actions/github": "5.1.1",
"minimatch": "5.1.0"
},
"devDependencies": {
"@octokit/webhooks-types": "6.4.0",
"@types/jest": "28.1.4",
"@types/minimatch": "3.0.5",
"@types/node": "18.7.18",
"@types/jest": "29.1.1",
"@types/minimatch": "5.1.2",
"@types/node": "18.8.0",
"@typescript-eslint/parser": "5.38.1",
"@vercel/ncc": "0.34.0",
"casual": "1.6.2",
"eslint": "8.19.0",
"eslint-plugin-github": "4.3.6",
"eslint": "8.24.0",
"eslint-plugin-github": "4.3.7",
"eslint-plugin-jest": "27.0.4",
"eslint-plugin-prettier": "4.2.1",
"jest": "28.1.2",
"jest": "29.1.2",
"js-yaml": "4.1.0",
"prettier": "2.7.1",
"ts-jest": "28.0.5",
"typescript": "4.7.4"
"ts-jest": "29.0.3",
"typescript": "4.8.4"
}
}
2 changes: 1 addition & 1 deletion src/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jest.mock('./runner');

test('fails CI on exception', async () => {
// Given
(assignMilestone as jest.Mock).mockRejectedValueOnce('The assignment failed');
(assignMilestone as jest.Mock<() => Promise<void>>).mockRejectedValueOnce('The assignment failed');

// When
await run();
Expand Down
42 changes: 28 additions & 14 deletions src/runner.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,23 @@ test('returns a PR for the given context', async () => {
data: [milestone],
});

(getBooleanInput as jest.Mock).mockImplementation((inputName: string) => {
(getBooleanInput as jest.Mock<(input: string) => boolean>).mockImplementation((inputName: string) => {
switch (inputName) {
case 'use-expression':
return false;
case 'allow-inactive':
return false;
}
return false;
});
(getInput as jest.Mock).mockImplementation((inputName: string) => {
(getInput as jest.Mock<(input: string) => string>).mockImplementation((inputName: string) => {
switch (inputName) {
case 'github-token':
return '';
case 'milestone':
return milestone.title;
}
return '';
});

// When
Expand Down Expand Up @@ -131,21 +133,23 @@ test('allows milestones with same due date as the current date', async () => {
data: [milestone],
});

(getBooleanInput as jest.Mock).mockImplementation((inputName: string) => {
(getBooleanInput as jest.Mock<(input: string) => boolean>).mockImplementation((inputName: string) => {
switch (inputName) {
case 'use-expression':
return false;
case 'allow-inactive':
return false;
}
return false;
});
(getInput as jest.Mock).mockImplementation((inputName: string) => {
(getInput as jest.Mock<(input: string) => string>).mockImplementation((inputName: string) => {
switch (inputName) {
case 'github-token':
return '';
case 'milestone':
return milestone.title;
}
return '';
});

// When
Expand Down Expand Up @@ -179,21 +183,23 @@ test.each([['pull_request'], ['pull_request_target']])('supports %s events', asy
data: [milestone],
});

(getBooleanInput as jest.Mock).mockImplementation((inputName: string) => {
(getBooleanInput as jest.Mock<(input: string) => boolean>).mockImplementation((inputName: string) => {
switch (inputName) {
case 'use-expression':
return false;
case 'allow-inactive':
return false;
}
return false;
});
(getInput as jest.Mock).mockImplementation((inputName: string) => {
(getInput as jest.Mock<(input: string) => string>).mockImplementation((inputName: string) => {
switch (inputName) {
case 'github-token':
return '';
case 'milestone':
return milestone.title;
}
return '';
});

// When / Then
Expand Down Expand Up @@ -243,21 +249,23 @@ describe('use-expression', () => {
data: [milestone],
});

(getBooleanInput as jest.Mock).mockImplementation((inputName: string) => {
(getBooleanInput as jest.Mock<(input: string) => boolean>).mockImplementation((inputName: string) => {
switch (inputName) {
case 'use-expression':
return true;
case 'allow-inactive':
return false;
}
return false;
});
(getInput as jest.Mock).mockImplementation((inputName: string) => {
(getInput as jest.Mock<(input: string) => string>).mockImplementation((inputName: string) => {
switch (inputName) {
case 'github-token':
return '';
case 'milestone':
return 'This * milestone';
}
return '';
});

// When
Expand Down Expand Up @@ -293,21 +301,23 @@ describe('allow-inactive', () => {
data: [milestone],
});

(getBooleanInput as jest.Mock).mockImplementation((inputName: string) => {
(getBooleanInput as jest.Mock<(input: string) => boolean>).mockImplementation((inputName: string) => {
switch (inputName) {
case 'use-expression':
return false;
case 'allow-inactive':
return false;
}
return false;
});
(getInput as jest.Mock).mockImplementation((inputName: string) => {
(getInput as jest.Mock<(input: string) => string>).mockImplementation((inputName: string) => {
switch (inputName) {
case 'github-token':
return '';
case 'milestone':
return milestone.title;
}
return '';
});

// When/Then
Expand Down Expand Up @@ -336,21 +346,23 @@ describe('allow-inactive', () => {
data: [milestone],
});

(getBooleanInput as jest.Mock).mockImplementation((inputName: string) => {
(getBooleanInput as jest.Mock<(input: string) => boolean>).mockImplementation((inputName: string) => {
switch (inputName) {
case 'use-expression':
return false;
case 'allow-inactive':
return true;
}
return false;
});
(getInput as jest.Mock).mockImplementation((inputName: string) => {
(getInput as jest.Mock<(input: string) => string>).mockImplementation((inputName: string) => {
switch (inputName) {
case 'github-token':
return '';
case 'milestone':
return milestone.title;
}
return '';
});

// When
Expand Down Expand Up @@ -395,7 +407,7 @@ describe('users-file-path', () => {
});

(getBooleanInput as jest.Mock).mockReturnValue(false);
(getInput as jest.Mock).mockImplementation((inputName: string) => {
(getInput as jest.Mock<(input: string) => string>).mockImplementation((inputName: string) => {
switch (inputName) {
case 'github-token':
return '';
Expand All @@ -404,6 +416,7 @@ describe('users-file-path', () => {
case 'users-file-path':
return 'mock/file/path.txt';
}
return '';
});

// When
Expand Down Expand Up @@ -445,7 +458,7 @@ describe('users-file-path', () => {
});

(getBooleanInput as jest.Mock).mockReturnValue(false);
(getInput as jest.Mock).mockImplementation((inputName: string) => {
(getInput as jest.Mock<(input: string) => string>).mockImplementation((inputName: string) => {
switch (inputName) {
case 'github-token':
return '';
Expand All @@ -454,6 +467,7 @@ describe('users-file-path', () => {
case 'users-file-path':
return 'mock/file/path.txt';
}
return '';
});

// When
Expand Down
Loading

0 comments on commit 2bced0e

Please sign in to comment.