Skip to content

Commit

Permalink
Merge pull request #55 from Contentstack-Solutions/development
Browse files Browse the repository at this point in the history
Merge development to staging
  • Loading branch information
aman19K authored Oct 19, 2023
2 parents c8fa1a9 + 720e8cc commit 4ca631d
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions tests/tsgen/references.test.ts
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
const testData = require('./references.ct')
const testData = require("./references.ct");

import NullDocumentationGenerator from '../../src/lib/tsgen/docgen/nulldoc'
import tsgenFactory from '../../src/lib/tsgen/factory'
import NullDocumentationGenerator from "../../src/lib/tsgen/docgen/nulldoc";
import tsgenFactory from "../../src/lib/tsgen/factory";

const tsgen = tsgenFactory({
docgen: new NullDocumentationGenerator(),
naming: {
prefix: 'I',
prefix: "I",
},
})
});

describe('references', () => {
const result = tsgen(testData.references)
describe("references", () => {
const result = tsgen(testData.references);

test('metadata', () => {
const contentTypes = [...result.metadata.dependencies.contentTypes]
test("metadata", () => {
const contentTypes = [...result.metadata.dependencies.contentTypes];

expect(contentTypes).toEqual(
expect.arrayContaining(['IReferenceChild', 'IBoolean', 'IBuiltinExample'])
)
})
expect.arrayContaining(["IReferenceChild", "IBoolean", "IBuiltinExample"])
);
});

test('definition', () => {
test("definition", () => {
expect(result.definition).toMatchInlineSnapshot(`
"export interface IReferenceParent
{
/** Version */
version: 5 ;
title: string;
url: string;
single_reference: (IReferenceChild)[];
single_reference: (IReferenceChild);
multiple_reference?: (IReferenceChild | IBoolean | IBuiltinExample)[];
}"
`)
})
})
`);
});
});

0 comments on commit 4ca631d

Please sign in to comment.