mirror of https://github.com/IoTcat/FDC.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
647 B
33 lines
647 B
|
|
'use strict'; |
|
|
|
module.exports = function(schedule) { |
|
return { |
|
jobInGenerator: function(test) { |
|
test.expect(1); |
|
|
|
var job = new schedule.Job(function*() { |
|
test.ok(true); |
|
}); |
|
|
|
job.runOnDate(new Date(Date.now() + 3000)); |
|
|
|
setTimeout(function() { |
|
test.done(); |
|
}, 3250); |
|
}, |
|
jobContextInGenerator: function(test) { |
|
test.expect(1); |
|
|
|
var job = new schedule.Job('name of job', function*() { |
|
test.ok(this.name === 'name of job'); |
|
}); |
|
|
|
job.runOnDate(new Date(Date.now() + 3000)); |
|
|
|
setTimeout(function() { |
|
test.done(); |
|
}, 3250); |
|
} |
|
} |
|
}
|
|
|