@@ -58,6 +58,11 @@ describe("render()", () => {
5858 import { Asset, Entry } from \\"contentful\\"
5959 import { Document } from \\"@contentful/rich-text-types\\"
6060
61+ // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT MODIFY IT.
62+
63+ import { Asset, Entry } from \\"contentful\\"
64+ import { Document } from \\"@contentful/rich-text-types\\"
65+
6166 export interface IMyContentTypeFields {
6267 /** Array field */
6368 arrayField: (\\"one\\" | \\"of\\" | \\"the\\" | \\"above\\")[]
@@ -125,6 +130,11 @@ describe("render()", () => {
125130 expect ( await render ( contentTypes , locales , { localization : true } ) ) . toMatchInlineSnapshot ( `
126131 "// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT MODIFY IT.
127132
133+ import { Asset, Entry } from \\"contentful\\"
134+ import { Document } from \\"@contentful/rich-text-types\\"
135+
136+ // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT MODIFY IT.
137+
128138 import { Entry } from \\"contentful\\"
129139 import { Document } from \\"@contentful/rich-text-types\\"
130140
@@ -182,4 +192,52 @@ describe("render()", () => {
182192 "
183193 ` )
184194 } )
195+
196+ it ( "renders given a content type inside a namespace" , async ( ) => {
197+ expect ( await render ( contentTypes , locales , { namespace : "Codegen" } ) ) . toMatchInlineSnapshot ( `
198+ "// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT MODIFY IT.
199+
200+ import { Asset, Entry } from \\"contentful\\"
201+ import { Document } from \\"@contentful/rich-text-types\\"
202+
203+ declare namespace Codegen {
204+ // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT MODIFY IT.
205+
206+ import { Asset, Entry } from \\"contentful\\"
207+ import { Document } from \\"@contentful/rich-text-types\\"
208+
209+ export interface IMyContentTypeFields {
210+ /** Array field */
211+ arrayField: (\\"one\\" | \\"of\\" | \\"the\\" | \\"above\\")[]
212+ }
213+
214+ export interface IMyContentType extends Entry<IMyContentTypeFields> {
215+ sys: {
216+ id: string
217+ type: string
218+ createdAt: string
219+ updatedAt: string
220+ locale: string
221+ contentType: {
222+ sys: {
223+ id: \\"myContentType\\"
224+ linkType: \\"ContentType\\"
225+ type: \\"Link\\"
226+ }
227+ }
228+ }
229+ }
230+
231+ export type CONTENT_TYPE = \\"myContentType\\"
232+
233+ export type LOCALE_CODE = \\"en-US\\" | \\"pt-BR\\"
234+
235+ export type CONTENTFUL_DEFAULT_LOCALE_CODE = \\"en-US\\"
236+ }
237+
238+ export as namespace Codegen
239+ export = Codegen
240+ "
241+ ` )
242+ } )
185243} )
0 commit comments