mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-05 17:53:12 +02:00
Feat: add test for recursive function
This commit is contained in:
parent
f0f3330c8d
commit
9577d7f3b8
15
src/lib/openapi/nested-schemas.test.ts
Normal file
15
src/lib/openapi/nested-schemas.test.ts
Normal 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,
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user