|
1 | | -var should = require("should"); |
2 | | -var sinon = require("sinon"); |
3 | | -var MultiWatching = require("../lib/MultiWatching"); |
| 1 | +"use strict"; |
4 | 2 |
|
5 | | -var createWatching = function() { |
| 3 | +const should = require("should"); |
| 4 | +const sinon = require("sinon"); |
| 5 | +const MultiWatching = require("../lib/MultiWatching"); |
| 6 | + |
| 7 | +const createWatching = function() { |
6 | 8 | return { |
7 | 9 | invalidate: sinon.spy(), |
8 | 10 | close: sinon.spy() |
9 | 11 | }; |
10 | 12 | }; |
11 | 13 |
|
12 | | -describe("MultiWatching", function() { |
13 | | - var watchings, myMultiWatching; |
| 14 | +describe("MultiWatching", () => { |
| 15 | + let watchings, myMultiWatching; |
14 | 16 |
|
15 | | - beforeEach(function() { |
| 17 | + beforeEach(() => { |
16 | 18 | watchings = [createWatching(), createWatching()]; |
17 | 19 | myMultiWatching = new MultiWatching(watchings); |
18 | 20 | }); |
19 | 21 |
|
20 | | - describe('invalidate', function() { |
21 | | - beforeEach(function() { |
22 | | - myMultiWatching.invalidate(); |
23 | | - }); |
| 22 | + describe("invalidate", () => { |
| 23 | + beforeEach(() => myMultiWatching.invalidate()); |
24 | 24 |
|
25 | | - it('invalidates each watching', function() { |
| 25 | + it("invalidates each watching", () => { |
26 | 26 | watchings[0].invalidate.callCount.should.be.exactly(1); |
27 | 27 | watchings[1].invalidate.callCount.should.be.exactly(1); |
28 | 28 | }); |
29 | 29 | }); |
30 | 30 |
|
31 | | - describe('close', function() { |
32 | | - var callback; |
33 | | - var callClosedFinishedCallback = function(watching) { |
34 | | - watching.close.getCall(0).args[0](); |
35 | | - }; |
| 31 | + describe("close", () => { |
| 32 | + let callback; |
| 33 | + const callClosedFinishedCallback = (watching) => watching.close.getCall(0).args[0](); |
36 | 34 |
|
37 | | - beforeEach(function() { |
| 35 | + beforeEach(() => { |
38 | 36 | callback = sinon.spy(); |
39 | 37 | myMultiWatching.close(callback); |
40 | 38 | }); |
41 | 39 |
|
42 | | - it('closes each watching', function() { |
| 40 | + it("closes each watching", () => { |
43 | 41 | watchings[0].close.callCount.should.be.exactly(1); |
44 | 42 | watchings[1].close.callCount.should.be.exactly(1); |
45 | 43 | }); |
46 | 44 |
|
47 | | - it('calls callback after each watching has closed', function() { |
| 45 | + it("calls callback after each watching has closed", () => { |
48 | 46 | callClosedFinishedCallback(watchings[0]); |
49 | 47 | callClosedFinishedCallback(watchings[1]); |
50 | 48 | callback.callCount.should.be.exactly(1); |
|
0 commit comments