Skip to content

Commit c8d67b9

Browse files
committed
Re-format test-data
1 parent 6b3e203 commit c8d67b9

File tree

2 files changed

+122
-122
lines changed

2 files changed

+122
-122
lines changed

test/fail.js

Lines changed: 54 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -49,88 +49,87 @@
4949
this.assert(false, message + ' expected #{this} to fail');
5050
});
5151
});
52-
var tests = [];
53-
tests.push({
52+
var tests = [{
5453
name: 'properties',
5554
schema: {
56-
"properties": {
57-
"intKey": {
58-
"type": "integer"
55+
properties: {
56+
intKey: {
57+
type: 'integer'
5958
},
60-
"stringKey": {
61-
"type": "string"
59+
stringKey: {
60+
type: 'string'
6261
}
6362
}
6463
},
65-
valid: [
66-
{ data: {
67-
"intKey": 1,
68-
"stringKey": "one"
69-
}}
70-
],
71-
invalid: [
72-
{data: {
73-
"intKey": 3,
74-
"stringKey": false
75-
}}
76-
]
64+
valid: [{
65+
data: {
66+
intKey: 1,
67+
stringKey: 'one'
68+
}
69+
}],
70+
invalid: [{
71+
data: {
72+
intKey: 3,
73+
stringKey: false
74+
}
75+
}]
7776
}, {
7877
name: 'combinations',
7978
schema: {
80-
"id": "any_v1",
81-
"anyOf": [
82-
{"type": "integer"},
83-
{"type": "string"}
79+
id: 'any_v1',
80+
anyOf: [
81+
{ type: 'integer' },
82+
{ type: 'string' }
8483
]
8584
},
8685
valid: [
87-
{ data: 1},
88-
{ data: "yo"}
86+
{ data: 1 },
87+
{ data: 'yo' }
8988
],
9089
invalid: [
91-
{ data: [1, 2, 3]},
92-
{ data: {aa: 1}}
90+
{ data: [1, 2, 3] },
91+
{ data: { aa: 1 } }
9392
]
9493
}, {
9594
name: 'fruit',
9695
schema: {
97-
"id": "fruit_v1",
98-
"description": "fresh fruit schema v1",
99-
"type": "object",
100-
"properties": {
101-
"required": ["skin", "colors", "taste"],
102-
"colors": {
103-
"type": "array",
104-
"minItems": 1,
105-
"uniqueItems": true,
106-
"items": {
107-
"type": "string"
96+
id: 'fruit_v1',
97+
description: 'fresh fruit schema v1',
98+
type: 'object',
99+
properties: {
100+
required: ['skin', 'colors', 'taste'],
101+
colors: {
102+
type: 'array',
103+
minItems: 1,
104+
uniqueItems: true,
105+
items: {
106+
type: 'string'
108107
}
109108
},
110-
"skin": {
111-
"type": "string"
109+
skin: {
110+
type: 'string'
112111
},
113-
"taste": {
114-
"type": "number",
115-
"minimum": 5
112+
taste: {
113+
type: 'number',
114+
minimum: 5
116115
}
117116
}
118117
},
119-
valid: [
120-
{ data: {
121-
skin: "thin",
122-
colors: ["red", "green", "yellow"],
118+
valid: [{
119+
data: {
120+
skin: 'thin',
121+
colors: ['red', 'green', 'yellow'],
123122
taste: 10
124-
}}
125-
],
126-
invalid: [
127-
{data: {
128-
colors: ["brown"],
123+
}
124+
}],
125+
invalid: [{
126+
data: {
127+
colors: ['brown'],
129128
taste: 0,
130129
worms: 2
131-
}}
132-
]
133-
});
130+
}
131+
}]
132+
}];
134133

135134
it('has tests', function () {
136135
assert.isArray(tests, 'tests');

test/suite.js

Lines changed: 68 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -59,98 +59,99 @@
5959
});
6060

6161
describe('assertions', function () {
62-
var tests = [];
63-
tests.push({
62+
var tests = [{
6463
name: 'properties',
6564
schema: {
66-
"properties": {
67-
"intKey": {
68-
"type": "integer"
65+
properties: {
66+
intKey: {
67+
type: 'integer'
6968
},
70-
"stringKey": {
71-
"type": "string"
69+
stringKey: {
70+
type: 'string'
7271
}
7372
}
7473
},
75-
valid: [
76-
{ data: {
77-
"intKey": 1,
78-
"stringKey": "one"
79-
}}
80-
],
81-
invalid: [
82-
{data: {
83-
"intKey": 3,
84-
"stringKey": false
85-
}}
86-
]
87-
});
88-
tests.push({
74+
valid: [{
75+
data: {
76+
intKey: 1,
77+
stringKey: 'one'
78+
}
79+
}],
80+
invalid: [{
81+
data: {
82+
intKey: 3,
83+
stringKey: false
84+
}
85+
}]
86+
}, {
8987
name: 'fruit',
9088
schema: {
91-
"id": "fruit_v1",
92-
"description": "fresh fruit schema v1",
93-
"type": "object",
94-
"required": ["skin", "colors", "taste"],
95-
"properties": {
96-
"colors": {
97-
"type": "array",
98-
"minItems": 1,
99-
"uniqueItems": true,
100-
"items": {
101-
"type": "string"
89+
id: 'fruit_v1',
90+
description: 'fresh fruit schema v1',
91+
type: 'object',
92+
required: ['skin', 'colors', 'taste'],
93+
properties: {
94+
colors: {
95+
type: 'array',
96+
minItems: 1,
97+
uniqueItems: true,
98+
items: {
99+
type: 'string'
102100
}
103101
},
104-
"skin": {
105-
"type": "string"
102+
skin: {
103+
type: 'string'
106104
},
107-
"taste": {
108-
"type": "number",
109-
"minimum": 5
105+
taste: {
106+
type: 'number',
107+
minimum: 5
110108
},
111-
"worms": {
112-
"type": "number",
113-
"maximum": 1
109+
worms: {
110+
type: 'number',
111+
maximum: 1
114112
}
115113
}
116114
},
117-
valid: [
118-
{ data: {
119-
skin: "thin",
120-
colors: ["red", "green", "yellow"],
115+
valid: [{
116+
data: {
117+
skin: 'thin',
118+
colors: ['red', 'green', 'yellow'],
121119
taste: 10
122-
}},
123-
{ data: {
124-
skin: "thin",
125-
colors: ["yellow"],
120+
}
121+
}, {
122+
data: {
123+
skin: 'thin',
124+
colors: ['yellow'],
126125
taste: 5,
127126
worms: 1
128-
}}
129-
],
130-
invalid: [
131-
{ data: {
132-
skin: "thin",
133-
colors: ["yellow"],
127+
}
128+
}],
129+
invalid: [{
130+
data: {
131+
skin: 'thin',
132+
colors: ['yellow'],
134133
taste: 0
135-
}},
136-
{ data: {
137-
skin: "thin",
134+
}
135+
}, {
136+
data: {
137+
skin: 'thin',
138138
colors: [1, 2, 3],
139139
taste: 5
140-
}},
141-
{ data: {
140+
}
141+
}, {
142+
data: {
142143
skin: 321,
143-
colors: ["yellow"],
144+
colors: ['yellow'],
144145
taste: 5
145-
}},
146-
{ data: {
147-
skin: "thin",
148-
colors: ["yellow"],
146+
}
147+
}, { data: {
148+
skin: 'thin',
149+
colors: ['yellow'],
149150
taste: 5,
150151
worms: 3
151-
}}
152-
]
153-
});
152+
}
153+
}]
154+
}];
154155
describe('check test data', function () {
155156
it('has tests', function () {
156157
assert.isArray(tests, 'tests');

0 commit comments

Comments
 (0)