Skip to content

Commit

Permalink
test(job-scheduler): add test to verify returned job
Browse files Browse the repository at this point in the history
  • Loading branch information
manast committed Nov 19, 2024
1 parent 5bab0f1 commit 6ac3d09
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test_job_scheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1827,6 +1827,20 @@ describe('Job Scheduler', function () {
);
});

it("should return a valid job with the job's options and data passed as the job template", async function () {
const repeatOpts = {
every: 1000,
};

const job = await queue.upsertJobScheduler('test', repeatOpts, {
data: { foo: 'bar' },
});

expect(job).to.be.ok;
expect(job!.data.foo).to.be.eql('bar');
expect(job!.opts.repeat!.every).to.be.eql(1000);
});

it('should emit a waiting event when adding a repeatable job to the waiting list', async function () {
const date = new Date('2017-02-07 9:24:00');
this.clock.setSystemTime(date);
Expand Down

0 comments on commit 6ac3d09

Please sign in to comment.