diff --git a/packages/downgrader/tests/v3.1-to-v3.0.test.ts b/packages/downgrader/tests/v3.1-to-v3.0.test.ts index 888e513..6d95410 100644 --- a/packages/downgrader/tests/v3.1-to-v3.0.test.ts +++ b/packages/downgrader/tests/v3.1-to-v3.0.test.ts @@ -1394,6 +1394,9 @@ describe('downgradeSchemaV31ToV30', () => { const cyclic: Record = { anyOf: [{ type: 'null' }] } cyclic.anyOf.unshift({ anyOf: [cyclic, { type: 'null' }] }) expect(schemas({ A: pair('B'), B: cyclic })?.A).toEqual(ref('B')) + // A $ref beside the cycle is still followed. + cyclic.anyOf[0].anyOf.push(ref('A')) + expect(schemas({ A: pair('B'), B: cyclic })?.A).toEqual({ anyOf: [ref('B'), onlyNull] }) }) it('merges a branch in full where a cycle meets it before its conversion is done', () => {