Fix parseReferenceAnnotation missing annotation error message
Signed-off-by: Mike Haley <mike.f.haley@gmail.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-techdocs-node': patch
|
||||
---
|
||||
|
||||
Updated the error message thrown by parseReferenceAnnotation to reflect the annotation value passed as an argument rather than in correctly assuming location.
|
||||
@@ -113,9 +113,12 @@ describe('parseReferenceAnnotation', () => {
|
||||
});
|
||||
|
||||
it('should throw error without annotation', () => {
|
||||
const logMsgRegex = new RegExp(
|
||||
`No ${TECHDOCS_ANNOTATION} annotation provided`,
|
||||
);
|
||||
expect(() => {
|
||||
parseReferenceAnnotation(TECHDOCS_ANNOTATION, entityBase);
|
||||
}).toThrow(/No location annotation/);
|
||||
}).toThrow(logMsgRegex);
|
||||
});
|
||||
|
||||
it('should throw error with bad annotation', () => {
|
||||
|
||||
@@ -52,7 +52,7 @@ export const parseReferenceAnnotation = (
|
||||
const annotation = entity.metadata.annotations?.[annotationName];
|
||||
if (!annotation) {
|
||||
throw new InputError(
|
||||
`No location annotation provided in entity: ${entity.metadata.name}`,
|
||||
`No ${annotationName} annotation provided in entity: ${entity.metadata.name}`,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user