Skip to content

Commit a41c247

Browse files
replaced callback functions with ES6 arrow functions
1 parent fcf64c1 commit a41c247

26 files changed

Lines changed: 170 additions & 170 deletions

File tree

test/specs/__({[ % & $ # @ ` ~ ,)}]__/special-characters.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ const { expect } = require("chai");
77
const parsedSchema = require("./parsed");
88
const dereferencedSchema = require("./dereferenced");
99

10-
describe("File names with special characters", function () {
11-
it("should parse successfully", function () {
10+
describe("File names with special characters", () => {
11+
it("should parse successfully", () => {
1212
let parser = new $RefParser();
1313
return parser
1414
.parse(path.rel("specs/__({[ % & $ # @ ` ~ ,)}]__/__({[ % & $ # @ ` ~ ,)}]__.yaml"))
@@ -25,7 +25,7 @@ describe("File names with special characters", function () {
2525
path.abs("specs/__({[ % & $ # @ ` ~ ,)}]__/__({[ % & $ # @ ` ~ ,)}]__/__({[ % & $ # @ ` ~ ,)}]__.json"), parsedSchema.file
2626
));
2727

28-
it("should dereference successfully", function () {
28+
it("should dereference successfully", () => {
2929
let parser = new $RefParser();
3030
return parser
3131
.dereference(path.rel("specs/__({[ % & $ # @ ` ~ ,)}]__/__({[ % & $ # @ ` ~ ,)}]__.yaml"))
@@ -38,7 +38,7 @@ describe("File names with special characters", function () {
3838
});
3939
});
4040

41-
it("should bundle successfully", function () {
41+
it("should bundle successfully", () => {
4242
let parser = new $RefParser();
4343
return parser
4444
.bundle(path.rel("specs/__({[ % & $ # @ ` ~ ,)}]__/__({[ % & $ # @ ` ~ ,)}]__.yaml"))

test/specs/blank/blank.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const path = require("../../utils/path");
88
const parsedSchema = require("./parsed");
99
const dereferencedSchema = require("./dereferenced");
1010

11-
describe("Blank files", function () {
11+
describe("Blank files", () => {
1212
let windowOnError, testDone;
1313

1414
beforeEach(function () {
@@ -24,7 +24,7 @@ describe("Blank files", function () {
2424
host.global.onerror = windowOnError;
2525
});
2626

27-
describe("main file", function () {
27+
describe("main file", () => {
2828
it("should throw an error for a blank YAML file", function (done) {
2929
testDone = done;
3030
$RefParser
@@ -69,7 +69,7 @@ describe("Blank files", function () {
6969
});
7070
});
7171

72-
describe("referenced files", function () {
72+
describe("referenced files", () => {
7373
it("should parse successfully", function (done) {
7474
testDone = done;
7575
$RefParser

test/specs/callbacks.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const path = require("../utils/path");
77

88
describe("Callback & Promise syntax", () => {
99
["parse", "resolve", "dereference", "bundle"].forEach(function (method) {
10-
describe(method + " method", function () {
10+
describe(method + " method", () => {
1111
it("should call the callback function upon success", testCallbackSuccess(method));
1212
it("should call the callback function upon failure", testCallbackError(method));
1313
it("should resolve the Promise upon success", testPromiseSuccess(method));

test/specs/circular-extended/circular-extended.spec.js

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ const dereferencedSchema = require("./dereferenced");
99
const bundledSchema = require("./bundled");
1010

1111
describe("Schema with circular $refs that extend each other", () => {
12-
describe("$ref to self", function () {
13-
it("should parse successfully", function () {
12+
describe("$ref to self", () => {
13+
it("should parse successfully", () => {
1414
let parser = new $RefParser();
1515
return parser
1616
.parse(path.rel("specs/circular-extended/circular-extended-self.yaml"))
@@ -31,7 +31,7 @@ describe("Schema with circular $refs that extend each other", () => {
3131
path.abs("specs/circular-extended/definitions/thing.yaml"), parsedSchema.thing
3232
));
3333

34-
it("should dereference successfully", function () {
34+
it("should dereference successfully", () => {
3535
let parser = new $RefParser();
3636
return parser
3737
.dereference(path.rel("specs/circular-extended/circular-extended-self.yaml"))
@@ -44,7 +44,7 @@ describe("Schema with circular $refs that extend each other", () => {
4444
});
4545
});
4646

47-
it('should not dereference circular $refs if "options.$refs.circular" is "ignore"', function () {
47+
it('should not dereference circular $refs if "options.$refs.circular" is "ignore"', () => {
4848
let parser = new $RefParser();
4949
return parser
5050
.dereference(path.rel("specs/circular-extended/circular-extended-self.yaml"), { dereference: { circular: "ignore" }})
@@ -57,7 +57,7 @@ describe("Schema with circular $refs that extend each other", () => {
5757
});
5858
});
5959

60-
it('should throw an error if "options.$refs.circular" is false', function () {
60+
it('should throw an error if "options.$refs.circular" is false', () => {
6161
let parser = new $RefParser();
6262
return parser
6363
.dereference(path.rel("specs/circular-extended/circular-extended-self.yaml"), { dereference: { circular: false }})
@@ -73,7 +73,7 @@ describe("Schema with circular $refs that extend each other", () => {
7373
});
7474
});
7575

76-
it("should bundle successfully", function () {
76+
it("should bundle successfully", () => {
7777
let parser = new $RefParser();
7878
return parser
7979
.bundle(path.rel("specs/circular-extended/circular-extended-self.yaml"))
@@ -88,8 +88,8 @@ describe("Schema with circular $refs that extend each other", () => {
8888
});
8989
});
9090

91-
describe("$ref to ancestor", function () {
92-
it("should parse successfully", function () {
91+
describe("$ref to ancestor", () => {
92+
it("should parse successfully", () => {
9393
let parser = new $RefParser();
9494
return parser
9595
.parse(path.rel("specs/circular-extended/circular-extended-ancestor.yaml"))
@@ -112,7 +112,7 @@ describe("Schema with circular $refs that extend each other", () => {
112112
path.abs("specs/circular-extended/definitions/animals.yaml"), parsedSchema.animals
113113
));
114114

115-
it("should dereference successfully", function () {
115+
it("should dereference successfully", () => {
116116
let parser = new $RefParser();
117117
return parser
118118
.dereference(path.rel("specs/circular-extended/circular-extended-ancestor.yaml"))
@@ -131,7 +131,7 @@ describe("Schema with circular $refs that extend each other", () => {
131131
});
132132
});
133133

134-
it('should not dereference circular $refs if "options.$refs.circular" is "ignore"', function () {
134+
it('should not dereference circular $refs if "options.$refs.circular" is "ignore"', () => {
135135
let parser = new $RefParser();
136136
return parser
137137
.dereference(path.rel("specs/circular-extended/circular-extended-ancestor.yaml"), { dereference: { circular: "ignore" }})
@@ -144,7 +144,7 @@ describe("Schema with circular $refs that extend each other", () => {
144144
});
145145
});
146146

147-
it('should throw an error if "options.$refs.circular" is false', function () {
147+
it('should throw an error if "options.$refs.circular" is false', () => {
148148
let parser = new $RefParser();
149149
return parser
150150
.dereference(path.rel("specs/circular-extended/circular-extended-ancestor.yaml"), { dereference: { circular: false }})
@@ -160,7 +160,7 @@ describe("Schema with circular $refs that extend each other", () => {
160160
});
161161
});
162162

163-
it("should bundle successfully", function () {
163+
it("should bundle successfully", () => {
164164
let parser = new $RefParser();
165165
return parser
166166
.bundle(path.rel("specs/circular-extended/circular-extended-ancestor.yaml"))
@@ -175,8 +175,8 @@ describe("Schema with circular $refs that extend each other", () => {
175175
});
176176
});
177177

178-
describe("indirect circular $refs", function () {
179-
it("should parse successfully", function () {
178+
describe("indirect circular $refs", () => {
179+
it("should parse successfully", () => {
180180
let parser = new $RefParser();
181181
return parser
182182
.parse(path.rel("specs/circular-extended/circular-extended-indirect.yaml"))
@@ -200,7 +200,7 @@ describe("Schema with circular $refs that extend each other", () => {
200200
path.abs("specs/circular-extended/definitions/animals.yaml"), parsedSchema.animals
201201
));
202202

203-
it("should dereference successfully", function () {
203+
it("should dereference successfully", () => {
204204
let parser = new $RefParser();
205205
return parser
206206
.dereference(path.rel("specs/circular-extended/circular-extended-indirect.yaml"))
@@ -221,7 +221,7 @@ describe("Schema with circular $refs that extend each other", () => {
221221
});
222222
});
223223

224-
it('should not dereference circular $refs if "options.$refs.circular" is "ignore"', function () {
224+
it('should not dereference circular $refs if "options.$refs.circular" is "ignore"', () => {
225225
let parser = new $RefParser();
226226
return parser
227227
.dereference(path.rel("specs/circular-extended/circular-extended-indirect.yaml"), { dereference: { circular: "ignore" }})
@@ -234,7 +234,7 @@ describe("Schema with circular $refs that extend each other", () => {
234234
});
235235
});
236236

237-
it('should throw an error if "options.$refs.circular" is false', function () {
237+
it('should throw an error if "options.$refs.circular" is false', () => {
238238
let parser = new $RefParser();
239239
return parser
240240
.dereference(path.rel("specs/circular-extended/circular-extended-indirect.yaml"), { dereference: { circular: false }})
@@ -250,7 +250,7 @@ describe("Schema with circular $refs that extend each other", () => {
250250
});
251251
});
252252

253-
it("should bundle successfully", function () {
253+
it("should bundle successfully", () => {
254254
let parser = new $RefParser();
255255
return parser
256256
.bundle(path.rel("specs/circular-extended/circular-extended-indirect.yaml"))
@@ -265,8 +265,8 @@ describe("Schema with circular $refs that extend each other", () => {
265265
});
266266
});
267267

268-
describe("indirect circular and ancestor $refs", function () {
269-
it("should parse successfully", function () {
268+
describe("indirect circular and ancestor $refs", () => {
269+
it("should parse successfully", () => {
270270
let parser = new $RefParser();
271271
return parser
272272
.parse(path.rel("specs/circular-extended/circular-extended-indirect-ancestor.yaml"))
@@ -290,7 +290,7 @@ describe("Schema with circular $refs that extend each other", () => {
290290
path.abs("specs/circular-extended/definitions/animals.yaml"), parsedSchema.animals
291291
));
292292

293-
it("should dereference successfully", function () {
293+
it("should dereference successfully", () => {
294294
let parser = new $RefParser();
295295
return parser
296296
.dereference(path.rel("specs/circular-extended/circular-extended-indirect-ancestor.yaml"))
@@ -311,7 +311,7 @@ describe("Schema with circular $refs that extend each other", () => {
311311
});
312312
});
313313

314-
it('should not dereference circular $refs if "options.$refs.circular" is "ignore"', function () {
314+
it('should not dereference circular $refs if "options.$refs.circular" is "ignore"', () => {
315315
let parser = new $RefParser();
316316
return parser
317317
.dereference(path.rel("specs/circular-extended/circular-extended-indirect-ancestor.yaml"), { dereference: { circular: "ignore" }})
@@ -324,7 +324,7 @@ describe("Schema with circular $refs that extend each other", () => {
324324
});
325325
});
326326

327-
it('should throw an error if "options.$refs.circular" is false', function () {
327+
it('should throw an error if "options.$refs.circular" is false', () => {
328328
let parser = new $RefParser();
329329
return parser
330330
.dereference(path.rel("specs/circular-extended/circular-extended-indirect-ancestor.yaml"), { dereference: { circular: false }})
@@ -340,7 +340,7 @@ describe("Schema with circular $refs that extend each other", () => {
340340
});
341341
});
342342

343-
it("should bundle successfully", function () {
343+
it("should bundle successfully", () => {
344344
let parser = new $RefParser();
345345
return parser
346346
.bundle(path.rel("specs/circular-extended/circular-extended-indirect-ancestor.yaml"))

test/specs/circular-external/circular-external.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const dereferencedSchema = require("./dereferenced");
99
const bundledSchema = require("./bundled");
1010

1111
describe("Schema with circular (recursive) external $refs", () => {
12-
it("should parse successfully", function () {
12+
it("should parse successfully", () => {
1313
let parser = new $RefParser();
1414
return parser
1515
.parse(path.rel("specs/circular-external/circular-external.yaml"))
@@ -33,7 +33,7 @@ describe("Schema with circular (recursive) external $refs", () => {
3333
path.abs("specs/circular-external/definitions/person.yaml"), parsedSchema.person
3434
));
3535

36-
it("should dereference successfully", function () {
36+
it("should dereference successfully", () => {
3737
let parser = new $RefParser();
3838
return parser
3939
.dereference(path.rel("specs/circular-external/circular-external.yaml"))
@@ -51,7 +51,7 @@ describe("Schema with circular (recursive) external $refs", () => {
5151
});
5252
});
5353

54-
it('should throw an error if "options.$refs.circular" is false', function () {
54+
it('should throw an error if "options.$refs.circular" is false', () => {
5555
let parser = new $RefParser();
5656
return parser
5757
.dereference(path.rel("specs/circular-external/circular-external.yaml"), { dereference: { circular: false }})
@@ -67,7 +67,7 @@ describe("Schema with circular (recursive) external $refs", () => {
6767
});
6868
});
6969

70-
it("should bundle successfully", function () {
70+
it("should bundle successfully", () => {
7171
let parser = new $RefParser();
7272
return parser
7373
.bundle(path.rel("specs/circular-external/circular-external.yaml"))

test/specs/circular-multi/circular-multi.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const path = require("../../utils/path");
66
const bundledSchema = require("./bundled");
77

88
describe("multiple circular $refs at the same depth in the schema", () => {
9-
it("should bundle successfully", function () {
9+
it("should bundle successfully", () => {
1010
let parser = new $RefParser();
1111

1212
return parser

0 commit comments

Comments
 (0)