@@ -58,6 +58,11 @@ describe("render()", () => {
58
58
import { Asset, Entry } from \\"contentful\\"
59
59
import { Document } from \\"@contentful/rich-text-types\\"
60
60
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
+
61
66
export interface IMyContentTypeFields {
62
67
/** Array field */
63
68
arrayField: (\\"one\\" | \\"of\\" | \\"the\\" | \\"above\\")[]
@@ -125,6 +130,11 @@ describe("render()", () => {
125
130
expect ( await render ( contentTypes , locales , { localization : true } ) ) . toMatchInlineSnapshot ( `
126
131
"// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT MODIFY IT.
127
132
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
+
128
138
import { Entry } from \\"contentful\\"
129
139
import { Document } from \\"@contentful/rich-text-types\\"
130
140
@@ -182,4 +192,52 @@ describe("render()", () => {
182
192
"
183
193
` )
184
194
} )
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
+ } )
185
243
} )
0 commit comments