@@ -17,6 +17,8 @@ import path from 'path';
17
17
18
18
const schema = 'simple_model.graphql' ;
19
19
20
+ const skip = new Set ( [ 'v2-cyclic-has-one-dependency' , 'v2-cyclic-has-many-dependency' ] ) ;
21
+
20
22
describe ( 'build app - JS' , ( ) => {
21
23
let apiName : string ;
22
24
const projectRoot = path . resolve ( 'test-apps/ts' ) ;
@@ -39,16 +41,40 @@ describe('build app - JS', () => {
39
41
} ) ;
40
42
41
43
Object . entries ( schemas ) . forEach ( ( [ schemaName , schema ] ) => {
42
- // @ts -ignore
43
- it ( `builds with ${ schemaName } : ${ schema . description } ` , async ( ) => {
44
- // @ts -ignore
45
- const schemaText = `input AMPLIFY { globalAuthRule: AuthRule = { allow: public } }\n${ schema . sdl } ` ;
44
+ const testName = `builds with ${ schemaName } : ${ ( schema as any ) . description } ` ;
45
+ const testFunction = async ( ) => {
46
+ const schemaText = `input AMPLIFY { globalAuthRule: AuthRule = { allow: public } }\n${ ( schema as any ) . sdl } ` ;
46
47
updateApiSchemaWithText ( projectRoot , apiName , schemaText ) ;
47
48
apiGqlCompile ( projectRoot ) ;
48
49
await generateModels ( projectRoot ) ;
49
50
await generateStatementsAndTypes ( projectRoot ) ;
50
51
await craBuild ( projectRoot , { ...config } ) ;
51
- } ) ;
52
+ } ;
53
+ if ( skip . has ( schemaName ) ) {
54
+ it . skip ( testName , testFunction ) ;
55
+ } else {
56
+ it ( testName , testFunction ) ;
57
+ }
58
+ } ) ;
59
+
60
+ [
61
+ [ 'v2-cyclic-has-one-dependency' , schemas [ 'v2-cyclic-has-one-dependency' ] ] ,
62
+ [ 'v2-cyclic-has-many-dependency' , schemas [ 'v2-cyclic-has-many-dependency' ] ] ,
63
+ ] . forEach ( ( [ schemaName , schema ] ) => {
64
+ // @ts -ignore
65
+ const testName = `builds with ${ schemaName } : ${ schema . description } ` ;
66
+ const testFunction = async ( ) => {
67
+ const schemaText = `input AMPLIFY { globalAuthRule: AuthRule = { allow: public } }\n${ ( schema as any ) . sdl } ` ;
68
+ updateApiSchemaWithText ( projectRoot , apiName , schemaText ) ;
69
+ apiGqlCompile ( projectRoot ) ;
70
+ await generateModels ( projectRoot ) ;
71
+ await craBuild ( projectRoot , { ...config } ) ;
72
+ } ;
73
+ if ( skip . has ( schemaName ) ) {
74
+ it . skip ( testName , testFunction ) ;
75
+ } else {
76
+ it ( testName , testFunction ) ;
77
+ }
52
78
} ) ;
53
79
54
80
it ( 'fails build with syntax error in models' , async ( ) => {
0 commit comments