1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-10 17:53:36 +02:00

Feat: add test for recursive function

This commit is contained in:
Thomas Heartman 2022-06-27 15:02:34 +02:00
parent f0f3330c8d
commit 9577d7f3b8

View File

@ -0,0 +1,15 @@
import { includeSchemasRecursively } from './nested-schemas';
test('includeSchemasRecursively', () => {
const schemaFour = { components: {} };
const schemaThree = { components: { schemas: { schemaFour } } };
const schemaOne = {
components: { schemas: { schemaTwo: schemaFour, schemaThree } },
};
expect(includeSchemasRecursively({ schemaOne })).toEqual({
schemaOne,
schemaTwo: schemaFour,
schemaThree,
schemaFour,
});
});