| 1 | 'use strict'; |
| 2 | |
| 3 | describe('retries', function () { |
| 4 | var times = 0; |
| 5 | before(function () { |
| 6 | console.log('before'); |
| 7 | }); |
| 8 | |
| 9 | after(function () { |
| 10 | console.log('after'); |
| 11 | }); |
| 12 | |
| 13 | beforeEach(function () { |
| 14 | console.log('before each', times); |
| 15 | }); |
| 16 | |
| 17 | afterEach(function () { |
| 18 | console.log('after each', times); |
| 19 | }); |
| 20 | |
| 21 | it('should allow override and run appropriate hooks', function (done) { |
| 22 | this.timeout(100); |
| 23 | this.retries(2); |
| 24 | console.log('TEST', times); |
| 25 | if (++times < 3) { |
| 26 | return setTimeout(done, 300); |
| 27 | } |
| 28 | setTimeout(done, 50); |
| 29 | }); |
| 30 | }); |