From a65e0655914ac5aef18ee41ada71145e815f3715 Mon Sep 17 00:00:00 2001 From: Eddy Nguyen Date: Sun, 26 Feb 2023 16:54:50 +1100 Subject: [PATCH] Clean up --- .../resolvers/tests/ts-resolvers.spec.ts | 84 +++++++++---------- 1 file changed, 41 insertions(+), 43 deletions(-) diff --git a/packages/plugins/typescript/resolvers/tests/ts-resolvers.spec.ts b/packages/plugins/typescript/resolvers/tests/ts-resolvers.spec.ts index 0530747457e9..8159a77bbc62 100644 --- a/packages/plugins/typescript/resolvers/tests/ts-resolvers.spec.ts +++ b/packages/plugins/typescript/resolvers/tests/ts-resolvers.spec.ts @@ -1430,22 +1430,22 @@ export type ResolverFn = ( const content = await plugin(testSchema, [], {}, { outputFile: 'graphql.ts' }); expect(tsContent.content).toBeSimilarStringTo(` - export type CccFoo = { - __typename?: 'CCCFoo'; - foo: Scalars['String']; - }; + export type CccFoo = { + __typename?: 'CCCFoo'; + foo: Scalars['String']; + }; `); expect(tsContent.content).toBeSimilarStringTo(` - export type CccBar = { - __typename?: 'CCCBar'; - bar: Scalars['String']; - }; + export type CccBar = { + __typename?: 'CCCBar'; + bar: Scalars['String']; + }; `); expect(content.content).toBeSimilarStringTo(` - export type ResolversUnionTypes = { - CCCUnion: ( CccFoo ) | ( CccBar ); - } + export type ResolversUnionTypes = { + CCCUnion: ( CccFoo ) | ( CccBar ); + }; `); expect(content.content).toBeSimilarStringTo(` /** Mapping between all available schema types and the resolvers types */ @@ -1784,44 +1784,42 @@ export type ResolverFn = ( const content = await plugin(testSchema, [], {}, { outputFile: 'graphql.ts' }); expect(content.content).toBeSimilarStringTo(` - export type ResolversUnionTypes = { - UserPayload: ( UserResult ) | ( StandardError ); - PostsPayload: ( PostsResult ) | ( StandardError ); - }; + export type ResolversUnionTypes = { + UserPayload: ( UserResult ) | ( StandardError ); + PostsPayload: ( PostsResult ) | ( StandardError ); + }; `); expect(content.content).toBeSimilarStringTo(` - /** Mapping between all available schema types and the resolvers types */ - export type ResolversTypes = { - Query: ResolverTypeWrapper<{}>; - ID: ResolverTypeWrapper; - StandardError: ResolverTypeWrapper; - String: ResolverTypeWrapper; - User: ResolverTypeWrapper; - UserResult: ResolverTypeWrapper; - UserPayload: ResolverTypeWrapper; - Post: ResolverTypeWrapper; - PostsResult: ResolverTypeWrapper; - PostsPayload: ResolverTypeWrapper; - Boolean: ResolverTypeWrapper; - }; + export type ResolversTypes = { + Query: ResolverTypeWrapper<{}>; + ID: ResolverTypeWrapper; + StandardError: ResolverTypeWrapper; + String: ResolverTypeWrapper; + User: ResolverTypeWrapper; + UserResult: ResolverTypeWrapper; + UserPayload: ResolverTypeWrapper; + Post: ResolverTypeWrapper; + PostsResult: ResolverTypeWrapper; + PostsPayload: ResolverTypeWrapper; + Boolean: ResolverTypeWrapper; + }; `); expect(content.content).toBeSimilarStringTo(` - /** Mapping between all available schema types and the resolvers parents */ - export type ResolversParentTypes = { - Query: {}; - ID: Scalars['ID']; - StandardError: StandardError; - String: Scalars['String']; - User: User; - UserResult: UserResult; - UserPayload: ResolversUnionTypes['UserPayload']; - Post: Post; - PostsResult: PostsResult; - PostsPayload: ResolversUnionTypes['PostsPayload']; - Boolean: Scalars['Boolean']; - }; + export type ResolversParentTypes = { + Query: {}; + ID: Scalars['ID']; + StandardError: StandardError; + String: Scalars['String']; + User: User; + UserResult: UserResult; + UserPayload: ResolversUnionTypes['UserPayload']; + Post: Post; + PostsResult: PostsResult; + PostsPayload: ResolversUnionTypes['PostsPayload']; + Boolean: Scalars['Boolean']; + }; `); });