10000 Fix error throwing expectation tests. · github4f/node-cron@46c0067 · GitHub
[go: up one dir, main page]

Skip to content

Commit 46c0067

Browse files
Fix error throwing expectation tests.
1 parent a078d40 commit 46c0067

File tree

4 files changed

+30
-28
lines changed

4 files changed

+30
-28
lines changed

bower.json

Expand all lines: bower.json
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"cliftonc",
1111
"neyric",
1212
"humanchimp",
13-
"danhbear"
13+
"danhbear",
14+
"Jordan Abderrachid<jabderrachid@gmail.com>"
1415
],
1516
"description": "js cron handler",
1617
"main": ["lib/cron.js"],

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"Dan Bear <daniel@hulu.com> (https://github.com/danhbear)",
4040
"Vadim Baryshev <vadimbaryshev@gmail.com> (https://github.com/baryshev)",
4141
"Leandro Ferrari <lfthomaz@gmail.com> (https://github.com/lfthomaz)",
42-
"Gregg Zigler <greggzigler@gmail.com> (https://github.com/greggzigler)"
42+
"Gregg Zigler <greggzigler@gmail.com> (https://github.com/greggzigler)",
43+
"Jordan Abderrachid <jabderrachid@gmail.com> (https://github.com/jordanabderrachid)"
4344
]
4445
}

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: 25 additions & 25 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,7 +180,7 @@ 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
});
@@ -203,37 +203,37 @@ describe('crontime', function() {
203203
it('(L * * * * *)', function() {
204204
expect(function() {
205205
new cron.CronTime('L * * * * *');
206-
}).to.throw;
206+
}).to.throw(Error);
207207
});
208208

209209
it('(* L * * * *)', function() {
210210
expect(function() {
211211
new cron.CronTime('* L * * * *');
212-
}).to.throw;
212+
}).to.throw(Error);
213213
});
214214

215215
it('(* * L * * *)', function() {
216216
expect(function() {
217217
new cron.CronTime('* * L * * *');
218-
}).to.throw;
218+
}).to.throw(Error);
219219
});
220220

221221
it('(* * * L * *)', function() {
222222
expect(function() {
223223
new cron.CronTime('* * * L * *');
224-
}).to.throw;
224+
}).to.throw(Error);
225225
});
226226

227227
it('(* * * * L *)', function() {
228228
expect(function() {
229229
new cron.CronTime('* * * * L *');
230-
}).to.throw;
230+
}).to.throw(Error);
231231
});
232232

233233
it('(* * * * * L)', function() {
234234
expect(function() {
235235
new cron.CronTime('* * * * * L');
236-
}).to.throw;
236+
}).to.throw(Error);
237237
});
238238
});
239239
});

0 commit comments

Comments
 (0)
0