diff --git a/shared/src/commands/generate/components/instantiate.spec.ts b/shared/src/commands/generate/components/instantiate.spec.ts index 0df1e91e1..f4927995f 100644 --- a/shared/src/commands/generate/components/instantiate.spec.ts +++ b/shared/src/commands/generate/components/instantiate.spec.ts @@ -1,6 +1,5 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -import { arrayBuffer } from 'stream/consumers'; import { SchemaDirectory } from '../schema-directory'; import { instantiateGenericObject } from './instantiate'; @@ -164,113 +163,4 @@ describe('instantiateGenericObject', () => { }, ); }); -}); - -function getSampleArrayContents(properties: any, required: string[] = []): any { - return { - type: 'array', - prefixItems: [ - { - properties: properties, - required: required - } - ] - }; -} - - -// describe('instantiateGenericObject', () => { - -// it('return instantiated node with array property', () => { -// const pattern = getSampleNodeInterfaces({ -// 'property-name': { -// type: 'array' -// } -// }); -// expect(instantiateNodeInterfaces(pattern, mockSchemaDir, false, true)) -// .toEqual( -// [{ -// 'property-name': [ -// '{{ PROPERTY_NAME }}' -// ] -// }] -// ); -// }); - -// it('return instantiated node with string property', () => { -// const pattern = getSampleNodeInterfaces({ -// 'property-name': { -// type: 'string' -// } -// }); - -// expect(instantiateNodeInterfaces(pattern, mockSchemaDir, false, true)) -// .toEqual([ -// { -// 'property-name': '{{ PROPERTY_NAME }}' -// } -// ]); -// }); - -// it('return instantiated node with const property', () => { -// const pattern = getSampleNodeInterfaces({ -// 'property-name': { -// const: 'value here' -// } -// }); - -// expect(instantiateNodeInterfaces(pattern, mockSchemaDir, false, true)) -// .toEqual([ -// { -// 'property-name': 'value here' -// } -// ]); -// }); - -// it('only instantiate required properties when instantiateAll set to false', () => { -// const pattern = getSampleNodeInterfaces({ -// 'property-name': { -// const: 'value here' -// }, -// 'ignored-prop': { -// const: 'value here' -// } -// }, ['property-name']); - -// expect(instantiateNodeInterfaces(pattern, mockSchemaDir, false, false)) -// .toEqual([ -// { -// 'property-name': 'value here' -// } -// ]); -// }); - -// it('call schema directory to resolve $ref interfaces`', () => { -// const reference = 'https://calm.com/core.json#/interface'; - -// const pattern = { -// prefixItems: [ -// { -// '$ref': reference -// } -// ] -// }; - -// const spy = jest.spyOn(mockSchemaDir, 'getDefinition'); -// spy.mockReturnValue({ -// properties: { -// 'property-name': { -// const: 'value here' -// } -// } -// }); - -// expect(instantiateNodeInterfaces(pattern, mockSchemaDir, false, true)) -// .toEqual([ -// { -// 'property-name': 'value here' -// } -// ]); -// expect(spy).toHaveBeenCalledWith(reference); -// }); -// }); \ No newline at end of file +}); \ No newline at end of file