Skip to content

Commit 2be0bb8

Browse files
authored
Merge pull request taskcluster#297 from taskcluster/renovate/mocha-6.x
Update dependency mocha to v6
2 parents 49ddf8e + c385764 commit 2be0bb8

File tree

11 files changed

+272
-234
lines changed

11 files changed

+272
-234
lines changed

clients/client/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
},
2121
"devDependencies": {
2222
"http-proxy": "^1.17.0",
23-
"mocha": "^5.2.0",
23+
"mocha": "^6.0.0",
2424
"nock": "^10.0.6"
2525
},
2626
"engines": {

libraries/iterate/test/iterate_test.js

+20-20
Original file line numberDiff line numberDiff line change
@@ -49,23 +49,23 @@ class IterateEvents {
4949

5050
}
5151

52-
describe('Iterate', () => {
52+
suite('Iterate', () => {
5353
let clock;
5454
let manager;
5555
let monitor;
5656

57-
beforeEach(async () => {
57+
setup(async () => {
5858
manager = new MonitorManager({serviceName: 'iterate'});
5959
manager.setup({mock: true});
6060
monitor = manager.monitor();
6161
});
6262

63-
afterEach(() => {
63+
teardown(() => {
6464
sandbox.restore();
6565
manager.terminate();
6666
});
6767

68-
it('should be able to start and stop', done => {
68+
test('should be able to start and stop', done => {
6969
let iterations = 0;
7070

7171
let i = new subject({
@@ -111,7 +111,7 @@ describe('Iterate', () => {
111111

112112
});
113113

114-
it('should stop after correct number of iterations', done => {
114+
test('should stop after correct number of iterations', done => {
115115
let iterations = 0;
116116

117117
let i = new subject({
@@ -144,7 +144,7 @@ describe('Iterate', () => {
144144
});
145145
});
146146

147-
it('should emit error when iteration watchdog expires', done => {
147+
test('should emit error when iteration watchdog expires', done => {
148148
let iterations = 0;
149149

150150
let i = new subject({
@@ -173,7 +173,7 @@ describe('Iterate', () => {
173173
i.start();
174174
});
175175

176-
it('should emit error when overall iteration limit is hit', done => {
176+
test('should emit error when overall iteration limit is hit', done => {
177177
let iterations = 0;
178178

179179
let i = new subject({
@@ -200,7 +200,7 @@ describe('Iterate', () => {
200200
i.start();
201201
});
202202

203-
it('should emit error when iteration is too quick', done => {
203+
test('should emit error when iteration is too quick', done => {
204204
let iterations = 0;
205205

206206
let i = new subject({
@@ -224,7 +224,7 @@ describe('Iterate', () => {
224224
});
225225
});
226226

227-
it('should emit error after too many failures', done => {
227+
test('should emit error after too many failures', done => {
228228
let iterations = 0;
229229

230230
let i = new subject({
@@ -249,7 +249,7 @@ describe('Iterate', () => {
249249

250250
});
251251

252-
it('should cause uncaughtException when error event is unhandled', done => {
252+
test('should cause uncaughtException when error event is unhandled', done => {
253253
let iterations = 0;
254254

255255
// NOTE: Mocha has it's own uncaught exception listener. If we were to
@@ -289,7 +289,7 @@ describe('Iterate', () => {
289289

290290
});
291291

292-
it('should share state between iterations', done => {
292+
test('should share state between iterations', done => {
293293
let iterations = 0;
294294
let v = {a: 1};
295295

@@ -339,7 +339,7 @@ describe('Iterate', () => {
339339
});
340340
});
341341

342-
it('should emit correct events for single iteration', done => {
342+
test('should emit correct events for single iteration', done => {
343343
let iterations = 0;
344344

345345
let i = new subject({
@@ -376,7 +376,7 @@ describe('Iterate', () => {
376376
i.start();
377377
});
378378

379-
it('should emit correct events with maxIterations', done => {
379+
test('should emit correct events with maxIterations', done => {
380380
let iterations = 0;
381381

382382
let i = new subject({
@@ -419,9 +419,9 @@ describe('Iterate', () => {
419419
i.start();
420420
});
421421

422-
describe('event emission ordering', () => {
422+
suite('event emission ordering', () => {
423423

424-
it('should be correct with maxFailures and maxIterations', done => {
424+
test('should be correct with maxFailures and maxIterations', done => {
425425
let iterations = 0;
426426

427427
let i = new subject({
@@ -458,7 +458,7 @@ describe('Iterate', () => {
458458
i.start();
459459
});
460460

461-
it('should be correct with maxFailures only', done => {
461+
test('should be correct with maxFailures only', done => {
462462
let iterations = 0;
463463

464464
let i = new subject({
@@ -493,7 +493,7 @@ describe('Iterate', () => {
493493
i.start();
494494
});
495495

496-
it('should be correct when handler takes too little time', done => {
496+
test('should be correct when handler takes too little time', done => {
497497
let iterations = 0;
498498

499499
let i = new subject({
@@ -527,7 +527,7 @@ describe('Iterate', () => {
527527
i.start();
528528
});
529529

530-
it('should be correct when handler takes too long (incremental watchdog)', done => {
530+
test('should be correct when handler takes too long (incremental watchdog)', done => {
531531
let iterations = 0;
532532

533533
let i = new subject({
@@ -562,7 +562,7 @@ describe('Iterate', () => {
562562
i.start();
563563
});
564564

565-
it('should be correct when handler takes too long (overall time)', done => {
565+
test('should be correct when handler takes too long (overall time)', done => {
566566
let iterations = 0;
567567

568568
let i = new subject({
@@ -598,7 +598,7 @@ describe('Iterate', () => {
598598
i.start();
599599
});
600600

601-
it('should be correct with mixed results', done => {
601+
test('should be correct with mixed results', done => {
602602
let iterations = 0;
603603

604604
let i = new subject({

libraries/iterate/test/watchdog_test.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ var subject = require('../lib/watchdog');
22
var sinon = require('sinon');
33
var assume = require('assume');
44

5-
describe('watchdog', function() {
6-
beforeEach(function() {
5+
suite('watchdog', function() {
6+
setup(function() {
77
this.clock = sinon.useFakeTimers();
88
sinon.stub(process, 'exit');
99
process.exit.throws(new Error('process.exit'));
1010
});
1111

12-
afterEach(function() {
12+
teardown(function() {
1313
this.clock.restore();
1414
process.exit.restore();
1515
});
1616

17-
it('should emit when starting', function(done) {
17+
test('should emit when starting', function(done) {
1818
var w = new subject(10 * 1000);
1919
w.on('started', function() {
2020
done();
@@ -23,7 +23,7 @@ describe('watchdog', function() {
2323
w.stop();
2424
});
2525

26-
it('should emit when touched', function(done) {
26+
test('should emit when touched', function(done) {
2727
var w = new subject(10 * 1000);
2828
w.on('touched', function() {
2929
done();
@@ -33,7 +33,7 @@ describe('watchdog', function() {
3333
w.stop();
3434
});
3535

36-
it('should emit when stopped', function(done) {
36+
test('should emit when stopped', function(done) {
3737
var w = new subject(10 * 1000);
3838
w.on('stopped', function() {
3939
done();
@@ -42,7 +42,7 @@ describe('watchdog', function() {
4242
w.stop();
4343
});
4444

45-
it('should emit expired event', function(done) {
45+
test('should emit expired event', function(done) {
4646
var w = new subject(1 * 1000);
4747
w.on('expired', () => {
4848
done();
@@ -51,14 +51,14 @@ describe('watchdog', function() {
5151
this.clock.tick(1000);
5252
});
5353

54-
it('should not throw early', function() {
54+
test('should not throw early', function() {
5555
var w = new subject(1 * 1000);
5656
w.start();
5757
this.clock.tick(999);
5858
w.stop();
5959
});
6060

61-
it('should throw on time', function() {
61+
test('should throw on time', function() {
6262
var w = new subject(1 * 1000);
6363
w.start();
6464
assume(() => {
@@ -67,7 +67,7 @@ describe('watchdog', function() {
6767
w.stop();
6868
});
6969

70-
it('touching should reset timer', function() {
70+
test('touching should reset timer', function() {
7171
var w = new subject(1 * 1000);
7272
w.start();
7373
// We do this three times to ensure that the

0 commit comments

Comments
 (0)