mirror of
https://github.com/actions/stale.git
synced 2025-12-10 03:57:04 +00:00
feat(milestones): add new options to exempt all milestones (#291)
* refactor: move and rename the interfaces/classes closes #272 * docs: update the readme and action to describe the new options for milestones * refactor: split the tests into multiple files * feat(milestones): add new options to exempt all milestones * test: add coverage for the default values * test(milestones): add more coverage (wip) * test(milestones): add more coverage for the multiple exempt milestones * test: reduce duplicated code * test: change some describes * test: add more coverage * test: add more coverage * test: add final coverage * build(tsc): add missing project flag to build with the right tsconfig * test(milestones): use each to reduce the complexity of the tests * chore: fix an eslint issue with prettier on windows the end of line was wrong each time the os process the files * docs: move the contribution section to a dedicated file add more content to help the debug * chore: make sure the rebase is ok
This commit is contained in:
committed by
GitHub
parent
07f3f88b6d
commit
6a493760cf
34
__tests__/functions/generate-issue.ts
Normal file
34
__tests__/functions/generate-issue.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import {Issue} from '../../src/classes/issue';
|
||||
import {IIssuesProcessorOptions} from '../../src/interfaces/issues-processor-options';
|
||||
import {IsoDateString} from '../../src/types/iso-date-string';
|
||||
|
||||
export function generateIssue(
|
||||
options: IIssuesProcessorOptions,
|
||||
id: number,
|
||||
title: string,
|
||||
updatedAt: IsoDateString,
|
||||
createdAt: IsoDateString = updatedAt,
|
||||
isPullRequest = false,
|
||||
labels: string[] = [],
|
||||
isClosed = false,
|
||||
isLocked = false,
|
||||
milestone: string | undefined = undefined
|
||||
): Issue {
|
||||
return new Issue(options, {
|
||||
number: id,
|
||||
labels: labels.map(l => {
|
||||
return {name: l};
|
||||
}),
|
||||
title,
|
||||
created_at: createdAt,
|
||||
updated_at: updatedAt,
|
||||
pull_request: isPullRequest ? {} : null,
|
||||
state: isClosed ? 'closed' : 'open',
|
||||
locked: isLocked,
|
||||
milestone: milestone
|
||||
? {
|
||||
title: milestone
|
||||
}
|
||||
: undefined
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user