+9
-13
@@ -17,16 +17,6 @@ import { Entity, LocationSpec } from '@backstage/catalog-model';
|
||||
import { ConfigReader } from '@backstage/config';
|
||||
import { AnnotateScmSlugEntityProcessor } from './AnnotateScmSlugEntityProcessor';
|
||||
|
||||
const config = new ConfigReader({
|
||||
/* integrations: {
|
||||
github: [
|
||||
{
|
||||
host: 'github.com',
|
||||
},
|
||||
],
|
||||
},*/
|
||||
});
|
||||
|
||||
describe('AnnotateScmSlugEntityProcessor', () => {
|
||||
describe('github', () => {
|
||||
it('adds annotation', async () => {
|
||||
@@ -43,7 +33,9 @@ describe('AnnotateScmSlugEntityProcessor', () => {
|
||||
'https://github.com/backstage/backstage/blob/master/catalog-info.yaml',
|
||||
};
|
||||
|
||||
const processor = AnnotateScmSlugEntityProcessor.fromConfig(config);
|
||||
const processor = AnnotateScmSlugEntityProcessor.fromConfig(
|
||||
new ConfigReader({}),
|
||||
);
|
||||
|
||||
expect(await processor.preProcessEntity(entity, location)).toEqual({
|
||||
apiVersion: 'backstage.io/v1alpha1',
|
||||
@@ -74,7 +66,9 @@ describe('AnnotateScmSlugEntityProcessor', () => {
|
||||
'https://github.com/backstage/backstage/blob/master/catalog-info.yaml',
|
||||
};
|
||||
|
||||
const processor = AnnotateScmSlugEntityProcessor.fromConfig(config);
|
||||
const processor = AnnotateScmSlugEntityProcessor.fromConfig(
|
||||
new ConfigReader({}),
|
||||
);
|
||||
|
||||
expect(await processor.preProcessEntity(entity, location)).toEqual({
|
||||
apiVersion: 'backstage.io/v1alpha1',
|
||||
@@ -102,7 +96,9 @@ describe('AnnotateScmSlugEntityProcessor', () => {
|
||||
'https://gitlab.com/backstage/backstage/-/blob/master/catalog-info.yaml',
|
||||
};
|
||||
|
||||
const processor = AnnotateScmSlugEntityProcessor.fromConfig(config);
|
||||
const processor = AnnotateScmSlugEntityProcessor.fromConfig(
|
||||
new ConfigReader({}),
|
||||
);
|
||||
|
||||
expect(await processor.preProcessEntity(entity, location)).toEqual({
|
||||
apiVersion: 'backstage.io/v1alpha1',
|
||||
|
||||
Reference in New Issue
Block a user