diff --git a/plugins/catalog-backend/src/service/DefaultLocationService.test.ts b/plugins/catalog-backend/src/service/DefaultLocationService.test.ts index bd166cbd50..debf2e4b2f 100644 --- a/plugins/catalog-backend/src/service/DefaultLocationService.test.ts +++ b/plugins/catalog-backend/src/service/DefaultLocationService.test.ts @@ -197,7 +197,7 @@ describe('DefaultLocationServiceTest', () => { { type: 'url', target: 'https://backstage.io/catalog-info.yaml' }, true, ), - ).rejects.toThrowError('Duplicate nested entity: location:default/foo'); + ).rejects.toThrow(InputError); }); it('should return exists false when the location does not exist beforehand', async () => { @@ -264,6 +264,25 @@ describe('DefaultLocationServiceTest', () => { ), ).rejects.toThrow(InputError); }); + + it('should return default InputError for failed processed entities in dryRun mode', async () => { + store.listLocations.mockResolvedValueOnce([]); + + orchestrator.process.mockResolvedValueOnce({ + ok: false, + errors: [new Error('Error: Unable to read url')], + }); + + await expect( + locationService.createLocation( + { + type: 'url', + target: 'https://backstage.io/wrong-url/catalog-info.yaml', + }, + true, + ), + ).rejects.toThrow(InputError); + }); }); describe('listLocations', () => {