Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
RahulGautamSingh committed Dec 30, 2024
1 parent 8772675 commit 47f5b9d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions lib/workers/repository/update/pr/body/config-description.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@ describe('workers/repository/update/pr/body/config-description', () => {
);
});

it('displays later schedules', () => {
const res = getPrConfigDescription({
...config,
schedule: ['before 6am on Monday', 'after 3pm on Tuesday'],
});
expect(res).toContain(
'"before 6am on Monday,after 3pm on Tuesday" (UTC)',
);
});

it('renders undefined schedule', () => {
const res = getPrConfigDescription(config);
expect(res).toContain(`At any time (no schedule defined).`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function getReadableCronSchedule(scheduleText: string[]): string | null {
throwExceptionOnParseError: false,
})
.replace('Every minute, ', ''),
) + ` ( ${String(cron)} )`,
) + ` ( ${cron} )`,
)
.join(', ');
} catch {
Expand Down

0 comments on commit 47f5b9d

Please sign in to comment.