From 538b0a316809464bac9f9d952c4e6941f8da44a9 Mon Sep 17 00:00:00 2001 From: mingxuanzhang Date: Tue, 6 Aug 2024 13:09:53 -0700 Subject: [PATCH] chore: apply suggestion --- src/i18n/i18n.ts | 1 + test/service/templateService.test.ts | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/i18n/i18n.ts b/src/i18n/i18n.ts index 4181c13f..2e0f19ce 100644 --- a/src/i18n/i18n.ts +++ b/src/i18n/i18n.ts @@ -44,4 +44,5 @@ export const messages = { LightningInterfaceBundle: 'A Lightning Interface Bundle', LightningTest: 'A Lightning Test', RawOutput: 'target dir = %s\n%s', + templateTypeNotFound: 'The template type does not exist', }; diff --git a/test/service/templateService.test.ts b/test/service/templateService.test.ts index 99fd168e..122b8aca 100644 --- a/test/service/templateService.test.ts +++ b/test/service/templateService.test.ts @@ -478,6 +478,12 @@ describe('TemplateService', () => { } }); + it('should return an error if the generator does not exist', () => { + chai + .expect(() => importGenerator(20 as TemplateType)) + .to.throw(Error, nls.localize('templateTypeNotFound')); + }); + it('should create AnalyticsTemplate', async () => { await remove(path.join('testsoutput', 'libraryCreate', 'waveTemplates')); const templateService = TemplateService.getInstance();