mirror of
https://github.com/actions/stale.git
synced 2025-12-10 12:07:09 +00:00
feat(stale-and-close): add new options to change the days before close (#224)
* docs(readme): add new options in the documentation * chore: update the action schema * chore: parse the new arguments * feat(stale-and-close): add new options to change the days before close to avoid a breaking change and simplify the configuration the old options 'daysBeforeStale' and 'daysBeforePrClose' are kept and new options are available to override them with 'daysBeforeIssueStale', 'daysBeforePrStale', 'daysBeforeIssueClose' and 'daysBeforePrClose' * chore: rename the issue type enum to remove the enum suffix * chore: add missing dependency for eslint and typescript also upgrade the parser * chore: fix an issue with the linter for the shadow rules it was not configured properly for TypeScript * chore: use camelCase for constants * chore: use camelCase for enum members * chore: fix the tests * chore: enhance prettier to also lint other kind of files it was configured to only work with ts and it was not working well to be honest also now the lint scripts will also run prettier
This commit is contained in:
committed by
GitHub
parent
b12dccced8
commit
552e4c60f0
47
src/functions/should-mark-when-stale.spec.ts
Normal file
47
src/functions/should-mark-when-stale.spec.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import {shouldMarkWhenStale} from './should-mark-when-stale';
|
||||
|
||||
describe('shouldMarkWhenStale()', (): void => {
|
||||
let daysBeforeStale: number;
|
||||
|
||||
describe('when the given number of days indicate that it should be stalled', (): void => {
|
||||
beforeEach((): void => {
|
||||
daysBeforeStale = -1;
|
||||
});
|
||||
|
||||
it('should return false', (): void => {
|
||||
expect.assertions(1);
|
||||
|
||||
const result = shouldMarkWhenStale(daysBeforeStale);
|
||||
|
||||
expect(result).toStrictEqual(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('when the given number of days indicate that it should be stalled today', (): void => {
|
||||
beforeEach((): void => {
|
||||
daysBeforeStale = 0;
|
||||
});
|
||||
|
||||
it('should return true', (): void => {
|
||||
expect.assertions(1);
|
||||
|
||||
const result = shouldMarkWhenStale(daysBeforeStale);
|
||||
|
||||
expect(result).toStrictEqual(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe('when the given number of days indicate that it should be stalled tomorrow', (): void => {
|
||||
beforeEach((): void => {
|
||||
daysBeforeStale = 1;
|
||||
});
|
||||
|
||||
it('should return true', (): void => {
|
||||
expect.assertions(1);
|
||||
|
||||
const result = shouldMarkWhenStale(daysBeforeStale);
|
||||
|
||||
expect(result).toStrictEqual(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user