Skip to content

Commit 341f22b

Browse files
committed
Fix linting on tests
1 parent 1e4c30a commit 341f22b

File tree

1 file changed

+74
-76
lines changed

1 file changed

+74
-76
lines changed
+74-76
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const { generateSchema } = require('../../../lib/schema-generator/index')
2-
const Ajv = require("ajv")
2+
const Ajv = require('ajv')
33
const validator = new Ajv()
44

55
const TESTCASES = [
@@ -9,91 +9,90 @@ const TESTCASES = [
99
true,
1010
null,
1111
{},
12-
{ a: 1, b: 2, c: null, d: [ 1, 2, 3] },
13-
{ a: { b: { c: 1}}},
12+
{ a: 1, b: 2, c: null, d: [1, 2, 3] },
13+
{ a: { b: { c: 1 } } },
1414
[],
15-
[1,2,3],
16-
['a','b','c'],
15+
[1, 2, 3],
16+
['a', 'b', 'c'],
1717
[true, 'a', 1],
18-
[ { a: 1 }, { b: 'abc' } ],
18+
[{ a: 1 }, { b: 'abc' }],
1919
{
20-
"Account": {
21-
"Account Name": "Firefly",
22-
"Order": [
23-
{
24-
"OrderID": "order103",
25-
"Product": [
20+
Account: {
21+
'Account Name': 'Firefly',
22+
Order: [
2623
{
27-
"Product Name": "Bowler Hat",
28-
"ProductID": 858383,
29-
"SKU": "0406654608",
30-
"Description": {
31-
"Colour": "Purple",
32-
"Width": 300,
33-
"Height": 200,
34-
"Depth": 210,
35-
"Weight": 0.75
36-
},
37-
"Price": 34.45,
38-
"Quantity": 2
24+
OrderID: 'order103',
25+
Product: [
26+
{
27+
'Product Name': 'Bowler Hat',
28+
ProductID: 858383,
29+
SKU: '0406654608',
30+
Description: {
31+
Colour: 'Purple',
32+
Width: 300,
33+
Height: 200,
34+
Depth: 210,
35+
Weight: 0.75
36+
},
37+
Price: 34.45,
38+
Quantity: 2
39+
},
40+
{
41+
'Product Name': 'Trilby hat',
42+
ProductID: 858236,
43+
SKU: '0406634348',
44+
Description: {
45+
Colour: 'Orange',
46+
Width: 300,
47+
Height: 200,
48+
Depth: 210,
49+
Weight: 0.6
50+
},
51+
Price: 21.67,
52+
Quantity: 1
53+
}
54+
]
3955
},
4056
{
41-
"Product Name": "Trilby hat",
42-
"ProductID": 858236,
43-
"SKU": "0406634348",
44-
"Description": {
45-
"Colour": "Orange",
46-
"Width": 300,
47-
"Height": 200,
48-
"Depth": 210,
49-
"Weight": 0.6
50-
},
51-
"Price": 21.67,
52-
"Quantity": 1
57+
OrderID: 'order104',
58+
Product: [
59+
{
60+
'Product Name': 'Bowler Hat',
61+
ProductID: 858383,
62+
SKU: '040657863',
63+
Description: {
64+
Colour: 'Purple',
65+
Width: 300,
66+
Height: 200,
67+
Depth: 210,
68+
Weight: 0.75
69+
},
70+
Price: 34.45,
71+
Quantity: 4
72+
},
73+
{
74+
ProductID: 345664,
75+
SKU: '0406654603',
76+
'Product Name': 'Cloak',
77+
Description: {
78+
Colour: 'Black',
79+
Width: 30,
80+
Height: 20,
81+
Depth: 210,
82+
Weight: 2
83+
},
84+
Price: 107.99,
85+
Quantity: 1
86+
}
87+
]
5388
}
54-
]
55-
},
56-
{
57-
"OrderID": "order104",
58-
"Product": [
59-
{
60-
"Product Name": "Bowler Hat",
61-
"ProductID": 858383,
62-
"SKU": "040657863",
63-
"Description": {
64-
"Colour": "Purple",
65-
"Width": 300,
66-
"Height": 200,
67-
"Depth": 210,
68-
"Weight": 0.75
69-
},
70-
"Price": 34.45,
71-
"Quantity": 4
72-
},
73-
{
74-
"ProductID": 345664,
75-
"SKU": "0406654603",
76-
"Product Name": "Cloak",
77-
"Description": {
78-
"Colour": "Black",
79-
"Width": 30,
80-
"Height": 20,
81-
"Depth": 210,
82-
"Weight": 2
83-
},
84-
"Price": 107.99,
85-
"Quantity": 1
86-
}
87-
]
88-
}
89-
]
89+
]
9090
}
91-
}
91+
}
9292
]
9393

9494
describe('Schema Generator', function () {
95-
96-
TESTCASES.forEach( (value, index) => {
95+
TESTCASES.forEach((value, index) => {
9796
it('generates valid schema ' + index, function () {
9897
const schema = generateSchema(value)
9998
const validate = validator.compile(schema)
@@ -107,4 +106,3 @@ describe('Schema Generator', function () {
107106
})
108107
})
109108
})
110-

0 commit comments

Comments
 (0)