fix(core): update

This commit is contained in:
2019-04-10 14:06:20 +02:00
parent 6d8e39f11b
commit f9b81fc801
4 changed files with 113 additions and 53 deletions

View File

@ -6,6 +6,22 @@ let testCronManager: smarttime.CronManager;
tap.test('should create a valid instance of cronmanager', async () => {
testCronManager = new smarttime.CronManager();
expect(testCronManager).to.be.instanceOf(smarttime.CronManager);
});
tap.test('should create a valid cronJon', async (tools) => {
const done = tools.defer();
let counter = 0;
testCronManager.addCronjob('* * * * * *', () => {
if(counter === 10) {
done.resolve();
}
counter ++;
console.log(`hey ${counter}`);
});
testCronManager.start();
await done.promise;
testCronManager.stop();
});
tap.start();