mirror of
https://github.com/actions/stale.git
synced 2025-12-20 06:42:15 +00:00
feat(statistics): display some stats in the logs (#337)
* test: add more coverage * docs: reorder and enhance typo * docs(contributing): add more information about the npm scripts * feat(statistics): add simple statistics * feat(statistics): add more stats * refactor(issues-processor): remove some options from the constructor it should have been only useful for the tests * feat(statistics): add stats for new stale or undo stale issues * chore(rebase): handle rebase conflicts
This commit is contained in:
committed by
GitHub
parent
63ae8ac024
commit
419a53bc05
@@ -1,33 +0,0 @@
|
||||
import {getIssueType} from './get-issue-type';
|
||||
|
||||
describe('getIssueType()', (): void => {
|
||||
let isPullRequest: boolean;
|
||||
|
||||
describe('when the issue is a not pull request', (): void => {
|
||||
beforeEach((): void => {
|
||||
isPullRequest = false;
|
||||
});
|
||||
|
||||
it('should return that the issue is really an issue', (): void => {
|
||||
expect.assertions(1);
|
||||
|
||||
const result = getIssueType(isPullRequest);
|
||||
|
||||
expect(result).toStrictEqual('issue');
|
||||
});
|
||||
});
|
||||
|
||||
describe('when the issue is a pull request', (): void => {
|
||||
beforeEach((): void => {
|
||||
isPullRequest = true;
|
||||
});
|
||||
|
||||
it('should return that the issue is a pull request', (): void => {
|
||||
expect.assertions(1);
|
||||
|
||||
const result = getIssueType(isPullRequest);
|
||||
|
||||
expect(result).toStrictEqual('pr');
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,5 +0,0 @@
|
||||
import {IssueType} from '../enums/issue-type';
|
||||
|
||||
export function getIssueType(isPullRequest: Readonly<boolean>): IssueType {
|
||||
return isPullRequest ? IssueType.PullRequest : IssueType.Issue;
|
||||
}
|
||||
Reference in New Issue
Block a user