10000 Merge pull request #199 from jordanabderrachid/fix_throwing_expectati… · github4f/node-cron@b391dd2 · GitHub
[go: up one dir, main page]

Skip to content

Commit b391dd2

Browse files
committed
Merge pull request kelektiv#199 from jordanabderrachid/fix_throwing_expectation_tests
Fix error throwing expectation tests.
2 parents 033346b + 9348be1 commit b391dd2

File tree

4 files changed

+26
-22
lines changed

4 files changed

+26
-22
lines changed

bower.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"cliftonc",
1010
"neyric",
1111
"humanchimp",
12-
"danhbear"
12+
"danhbear",
13+
"Jordan Abderrachid<jabderrachid@gmail.com>"
1314
],
1415
"description": "js cron handler",
1516
"main": ["lib/cron.js"],

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"Dan Bear <daniel@hulu.com> (https://github.com/danhbear)",
3535
"Vadim Baryshev <vadimbaryshev@gmail.com> (https://github.com/baryshev)",
3636
"Leandro Ferrari <lfthomaz@gmail.com> (https://github.com/lfthomaz)",
37-
"Gregg Zigler <greggzigler@gmail.com> (https://github.com/greggzigler)"
37+
"Gregg Zigler <greggzigler@gmail.com> (https://github.com/greggzigler)",
38+
"Jordan Abderrachid <jabderrachid@gmail.com> (https://github.com/jordanabderrachid)"
3839
]
3940
}

tests/test-cron.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ describe('cron', function() {
416416
job.stop();
417417
expect(function() {
418418
job.setTime(time);
419-
}).to.throw;
419+
}).to.throw(Error);
420420

421421
clock.restore();
422422
job.stop();

tests/test-crontime.js

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,37 @@ describe('crontime', function() {
66
it('should test stars (* * * * * *)', function() {
77
expect(function() {
88
new cron.CronTime('* * * * * *');
9-
}).to.not.throw;
9+
}).to.not.throw(Error);
1010
});
1111

1212
it('should test digit (0 * * * * *)', function() {
1313
expect(function() {
1414
new cron.CronTime('0 * * * * *');
15-
}).to.not.throw;
15+
}).to.not.throw(Error);
1616
});
1717

1818
it('should test multi digits (08 * * * * *)', function() {
1919
expect(function() {
2020
new cron.CronTime('08 * * * * *');
21-
}).to.not.throw;
21+
}).to.not.throw(Error);
2222
});
2323

2424
it('should test all digits (08 8 8 8 8 5)', function() {
2525
expect(function() {
2626
new cron.CronTime('08 * * * * *');
27-
}).to.not.throw;
27+
}).to.not.throw(Error);
2828
});
2929

3030
it('should test too many digits (08 8 8 8 8 5)', function() {
3131
expect(function() {
3232
new cron.CronTime('08 * * * * *');
33-
}).to.not.throw;
33+
}).to.not.throw(Error);
3434
});
3535

3636
it('should test standard cron format (* * * * *)', function() {
3737
expect(function() {
3838
new cron.CronTime('* * * * *');
39-
}).to.not.throw;
39+
}).to.not.throw(Error);
4040
});
4141

4242
it('should test standard cron format (8 8 8 8 5)', function() {
@@ -55,69 +55,69 @@ describe('crontime', function() {
5555
it('should test hyphen (0-10 * * * * *)', function() {
5656
expect(function() {
5757
new cron.CronTime('0-10 * * * * *');
58-
}).to.not.throw;
58+
}).to.not.throw(Error);
5959
});
6060

6161
it('should test multi hyphens (0-10 0-10 * * * *)', function() {
6262
expect(function() {
6363
new cron.CronTime('0-10 0-10 * * * *');
64-
}).to.not.throw;
64+
}).to.not.throw(Error);
6565
});
6666

6767
it('should test all hyphens (0-10 0-10 0-10 0-10 0-10 0-1)', function() {
6868
expect(function() {
6969
new cron.CronTime('0-10 0-10 0-10 0-10 0-10 0-1');
70-
}).to.not.throw;
70+
}).to.not.throw(Error);
7171
});
7272

7373
it('should test comma (0,10 * * * * *)', function() {
7474
expect(function() {
7575
new cron.CronTime('0,10 * * * * *');
76-
}).to.not.throw;
76+
}).to.not.throw(Error);
7777
});
7878

7979
it('should test multi commas (0,10 0,10 * * * *)', function() {
8080
expect(function() {
8181
new cron.CronTime('0,10 0,10 * * * *');
82-
}).to.not.throw;
82+
}).to.not.throw(Error);
8383
});
8484

8585
it('should test all commas (0,10 0,10 0,10 0,10 0,10 0,1)', function() {
8686
expect(function() {
8787
new cron.CronTime('0,10 0,10 0,10 0,10 0,10 0,1');
88-
}).to.not.throw;
88+
}).to.not.throw(Error);
8989
});
9090

9191
it('should test alias (* * * * jan *)', function() {
9292
expect(function() {
9393
new cron.CronTime('* * * * jan *');
94-
}).to.not.throw;
94+
}).to.not.throw(Error);
9595
});
9696

9797
it('should test multi aliases (* * * * jan,feb *)', function() {
9898
expect(function() {
9999
new cron.CronTime('* * * * jan,feb *');
100-
}).to.not.throw;
100+
}).to.not.throw(Error);
101101
});
102102

103103
it('should test all aliases (* * * * jan,feb mon,tue)', function() {
104104
expect(function() {
105105
new cron.CronTime('* * * * jan,feb mon,tue');
106-
}).to.not.throw;
106+
}).to.not.throw(Error);
107107
});
108108

109109
it('should test every second monday (* * * * * mon/2)');
110110

111111
it('should test unknown alias (* * * * jar *)', function() {
112112
expect(function() {
113113
new cron.CronTime('* * * * jar *');
114-
}).to.throw;
114+
}).to.throw(Error);
115115
});
116116

117117
it('should test unknown alias - short (* * * * j *)', function() {
118118
expect(function() {
119119
new cron.CronTime('* * * * j *');
120-
}).to.throw;
120+
}).to.throw(Error);
121121
});
122122

123123
it('should test Date', function() {
@@ -142,7 +142,7 @@ describe('crontime', function() {
142142
it('should test illegal repetition syntax', function() {
143143
expect(function(){
144144
new cron.CronTime('* * /4 * * *');
145-
}).to.throw;
145+
}).to.throw(Error);
146146
});
147147

148148
it('should test next date', function() {
@@ -180,18 +180,20 @@ describe('crontime', function() {
180180
(function(m) {
181181
expect(function() {
182182
var ct = new cron.CronTime('0 0 0 33 ' + m + ' *');
183-
}).to.throw;
183+
}).to.throw(Error);
184184
})(ltm[i]);
185185
}
186186
});
187187

188188
it('should test next month selection');
189189

190190
describe('should throw an exception because `L` not supported', function() {
191+
191192
it('(* * * L * *)', function() {
192193
expect(function() {
193194
new cron.CronTime('* * * L * *');
194195
}).to.throw(Error);
196+
195197
});
196198

197199
it('(* * * * * L)', function() {

0 commit comments

Comments
 (0)
0