cron 1.0.5 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cron",
3
3
  "description": "Cron jobs for your node",
4
- "version": "1.0.5",
4
+ "version": "1.0.9",
5
5
  "author": "Nick Campbell <nicholas.j.campbell@gmail.com> (http://github.com/ncb000gt)",
6
6
  "bugs" : {
7
7
  "url" : "http://github.com/ncb000gt/node-cron/issues"
@@ -14,9 +14,12 @@
14
14
  "scripts": {
15
15
  "test": "make test"
16
16
  },
17
+ "dependencies": {
18
+ "moment-timezone": "~0.3.0"
19
+ },
17
20
  "devDependencies": {
18
21
  "nodeunit": ">=0.5.4",
19
- "time" : "0.8.0"
22
+ "sinon": "~1.12.x"
20
23
  },
21
24
  "licenses": [
22
25
  {
@@ -34,6 +37,7 @@
34
37
  "Craig Condon <craig@spiceapps.com> (https://github.com/spiceapps)",
35
38
  "Dan Bear <daniel@hulu.com> (https://github.com/danhbear)",
36
39
  "Vadim Baryshev <vadimbaryshev@gmail.com> (https://github.com/baryshev)",
37
- "Leandro Ferrari <lfthomaz@gmail.com> (https://github.com/lfthomaz)"
40
+ "Leandro Ferrari <lfthomaz@gmail.com> (https://github.com/lfthomaz)",
41
+ "Gregg Zigler <greggzigler@gmail.com> (https://github.com/greggzigler)"
38
42
  ]
39
43
  }
package/test.js CHANGED
@@ -1,22 +1,39 @@
1
1
  var CronJob = require('./lib/cron').CronJob;
2
+ var sinon = require('sinon');
2
3
 
3
- // WORK
4
- //var job1 = new CronJob('0 * * * * *',
5
- //function executeTick() {
6
- //console.log('job1', new Date());
7
- //},
8
- //function executeComplete() {
9
- //console.log('done...', new Date());
10
- //},
11
- //false
12
- //);
13
- //job1.start();
14
-
15
- var pattern = '00 12 32 * *';
16
-
17
- function run() {
18
- console.log('run at ' + new Date());
19
- };
20
-
21
- var job = new CronJob(pattern, run);
22
- job.start();
4
+ //var clock = sinon.useFakeTimers(new Date().getTime());
5
+
6
+ //var previous = 0;
7
+ //var counter = 0;
8
+ //var cronSyncSchedule = '*/1 * * * * *';
9
+
10
+ //var scheduleJob = new CronJob(cronSyncSchedule, function() {
11
+ //counter++;
12
+ //checkCounter();
13
+ //}, function() {
14
+ //console.log('scheduled job is completed successfully');
15
+ //}, true, null);
16
+
17
+ //function checkCounter() {
18
+ //console.log(counter + ' - ' + previous);
19
+ //if (counter != (previous + 1))
20
+ //console.log('SKIPPED: ' + (counter - 1) + ", COUNTER: " + counter);
21
+ //previous = counter;
22
+ //}
23
+
24
+ //clock.tick(31*24*60*60*1000);
25
+
26
+ //new CronJob('0 0 0 1 * *',function(){
27
+ //console.log("triggered");
28
+ //},null,true);
29
+
30
+ //clock.tick(24 * 60 * 60 * 1000);
31
+
32
+
33
+ //clock.restore();
34
+
35
+ //console.log(CronJob.prototype);
36
+ //
37
+ new CronJob('* * * * * *', function() {
38
+ console.log('tick: ' + Date.now());
39
+ }, null, true);