diff --git a/packages/mdctl-axon-tools/__tests__/MIG-166/MIG-166.test.js b/packages/mdctl-axon-tools/__tests__/MIG-166/MIG-166.test.js index 6c17c61f..6fc279c6 100644 --- a/packages/mdctl-axon-tools/__tests__/MIG-166/MIG-166.test.js +++ b/packages/mdctl-axon-tools/__tests__/MIG-166/MIG-166.test.js @@ -119,4 +119,16 @@ describe('MIG-166', () => { } }) }) + + it('should print "mdctl.kManifestNotFound.error" in case of missing manifest file.', async() => { + let err + try { + studyTranslations.isAuthTaskTranslations({}) + } catch (error) { + err = error + } + + expect(err.errCode) + .to.equal('mdctl.kManifestNotFound.error') + }) }) diff --git a/packages/mdctl-axon-tools/lib/StudyDataTranslations.js b/packages/mdctl-axon-tools/lib/StudyDataTranslations.js index b716417a..17921185 100644 --- a/packages/mdctl-axon-tools/lib/StudyDataTranslations.js +++ b/packages/mdctl-axon-tools/lib/StudyDataTranslations.js @@ -34,6 +34,10 @@ class StudyDataTranslations { } } + if (!manifestData) { + throw Fault.create('mdctl.kManifestNotFound.error', { reason: 'There is no manifest set as parameter neither found in directory' }) + } + if (manifestData.authenticationTaskTranslations && !_.has(manifestData, 'i18ns')) { throw Fault.create('mdctl.kInvalidArgument.missingI18nObjects', { message: 'The manifest is missing "i18ns" objects',