Skip to content

Commit 5ec1be1

Browse files
Refactored tests from PR #68
1 parent d570196 commit 5ec1be1

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

test/specs/complexOrder/complexOrder.bundled.js renamed to test/specs/circular-multi/circular-multi.bundled.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
1-
helper.bundled.complexOrder = {
1+
helper.bundled.circularMulti = {
22
$schema: 'http://json-schema.org/draft-07/schema#',
33
properties: {
44
actions: {
55
type: 'object',
66
properties: {
77
affirmativeAction: {
8+
$ref: '#/properties/actions/properties/prevAction'
9+
},
10+
negativeAction: {
11+
$ref: '#/properties/actions/properties/prevAction'
12+
},
13+
prevAction: {
814
type: 'object',
915
properties: {
1016
$id: 'text_assets',
1117
oneOf: [
1218
{
13-
$ref: '#/properties/actions/properties/affirmativeAction/properties/definitions/asset'
19+
$ref: '#/properties/actions/properties/prevAction/properties/definitions/asset'
1420
},
1521
{
16-
$ref: '#/properties/actions/properties/affirmativeAction/properties/definitions/asset'
22+
$ref: '#/properties/actions/properties/prevAction/properties/definitions/asset'
1723
}
1824
],
1925
definitions: {
2026
switchWrapper: {
2127
type: 'object',
22-
$ref: '#/properties/actions/properties/affirmativeAction/properties/definitions/switch'
28+
$ref: '#/properties/actions/properties/prevAction/properties/definitions/switch'
2329
},
2430
asset: {
2531
type: 'object',
2632
$id: 'asset_action',
2733
properties: {
2834
label: {
29-
$ref: '#/properties/actions/properties/affirmativeAction/properties'
35+
$ref: '#/properties/actions/properties/prevAction/properties'
3036
}
3137
}
3238
},
3339
switch: {
3440
type: 'array',
35-
$ref: '#/properties/actions/properties/affirmativeAction/properties/definitions/asset'
41+
$ref: '#/properties/actions/properties/prevAction/properties/definitions/asset'
3642
}
3743
}
3844
}
39-
},
40-
negativeAction: {
41-
$ref: '#/properties/actions/properties/affirmativeAction'
42-
},
43-
prevAction: {
44-
$ref: '#/properties/actions/properties/affirmativeAction'
4545
}
4646
}
4747
}
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
describe('$refs that are in the same file but also circular', function () {
1+
describe('multiple circular $refs at the same depth in the schema', function () {
22
'use strict';
33

44
it('should bundle successfully', function () {
55
var parser = new $RefParser();
66

77
return parser
8-
.bundle(path.rel('specs/complexOrder/definitions/root.json'))
8+
.bundle(path.rel('specs/circular-multi/definitions/root.json'))
99
.then(function (schema) {
1010
expect(schema).to.deep.equal(parser.schema);
11-
expect(schema).to.deep.equal(helper.bundled.complexOrder);
11+
expect(schema).to.deep.equal(helper.bundled.circularMulti);
1212
});
1313
});
1414
});

0 commit comments

Comments
 (0)