From 9a20028cd7863ff5c325142427198df5ebd46652 Mon Sep 17 00:00:00 2001 From: Michael Bromley Date: Thu, 22 Apr 2021 21:06:26 +0200 Subject: [PATCH] chore: Fix codegen --- packages/core/e2e/translations.e2e-spec.ts | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/packages/core/e2e/translations.e2e-spec.ts b/packages/core/e2e/translations.e2e-spec.ts index 05d47a62fb..ca27f24b40 100644 --- a/packages/core/e2e/translations.e2e-spec.ts +++ b/packages/core/e2e/translations.e2e-spec.ts @@ -41,7 +41,11 @@ describe('Translation', () => { }); it('shall receive german error message', async () => { - const { customErrorMessage } = await adminClient.query(CUSTOM_ERROR, {}, { languageCode: LanguageCode.de }); + const { customErrorMessage } = await adminClient.query( + CUSTOM_ERROR, + {}, + { languageCode: LanguageCode.de }, + ); expect(customErrorMessage.errorCode).toBe('CUSTOM_ERROR'); expect(customErrorMessage.message).toBe('DE_' + CUSTOM_ERROR_MESSAGE_TRANSLATION); }); @@ -49,21 +53,24 @@ describe('Translation', () => { describe('translation added by file', () => { it('shall receive custom error message', async () => { - const { newErrorMessage } = await adminClient.query(NEW_ERROR); + const { newErrorMessage } = await adminClient.query(gql(NEW_ERROR)); expect(newErrorMessage.errorCode).toBe('NEW_ERROR'); expect(newErrorMessage.message).toBe(EN.errorResult.NEW_ERROR); }); it('shall receive german error message', async () => { - const { newErrorMessage } = await adminClient.query(NEW_ERROR, {}, { languageCode: LanguageCode.de }); + const { newErrorMessage } = await adminClient.query( + gql(NEW_ERROR), + {}, + { languageCode: LanguageCode.de }, + ); expect(newErrorMessage.errorCode).toBe('NEW_ERROR'); expect(newErrorMessage.message).toBe(DE.errorResult.NEW_ERROR); }); }); - }); -const CUSTOM_ERROR = gql` +const CUSTOM_ERROR = ` query CustomError { customErrorMessage { ... on ErrorResult { @@ -74,7 +81,7 @@ const CUSTOM_ERROR = gql` } `; -const NEW_ERROR = gql` +const NEW_ERROR = ` query NewError { newErrorMessage { ... on ErrorResult {