From 450686ca2734ea2b46bfb26badc0a9596b4a4566 Mon Sep 17 00:00:00 2001 From: Johan Haals Date: Tue, 19 Jan 2021 15:32:09 +0100 Subject: [PATCH] Remove duplicated tests --- .../stages/prepare/preparers.test.ts | 102 ------------------ 1 file changed, 102 deletions(-) diff --git a/plugins/scaffolder-backend/src/scaffolder/stages/prepare/preparers.test.ts b/plugins/scaffolder-backend/src/scaffolder/stages/prepare/preparers.test.ts index db6160c276..7023f292f3 100644 --- a/plugins/scaffolder-backend/src/scaffolder/stages/prepare/preparers.test.ts +++ b/plugins/scaffolder-backend/src/scaffolder/stages/prepare/preparers.test.ts @@ -20,108 +20,6 @@ import { GithubPreparer } from './github'; import { ConfigReader } from '@backstage/config'; describe('Preparers', () => { - // const mockTemplate: TemplateEntityV1alpha1 = { - // apiVersion: 'backstage.io/v1alpha1', - // kind: 'Template', - // metadata: { - // annotations: { - // 'backstage.io/managed-by-location': - // 'file:/Users/bingo/backstage/plugins/scaffolder-backend/sample-templates/react-ssr-template/template.yaml', - // }, - // name: 'react-ssr-template', - // title: 'React SSR Template', - // description: - // 'Next.js application skeleton for creating isomorphic web applications.', - // uid: '7357f4c5-aa58-4a1e-9670-18931eef771f', - // etag: 'YWUxZWQyY2EtZDkxMC00MDM0LWI0ODAtMDgwMWY0YzdlMWIw', - // generation: 1, - // }, - // spec: { - // templater: 'cookiecutter', - // path: '.', - // type: 'website', - // schema: { - // $schema: 'http://json-schema.org/draft-07/schema#', - // required: ['storePath', 'owner'], - // properties: { - // owner: { - // type: 'string', - // title: 'Owner', - // description: 'Who is going to own this component', - // }, - // storePath: { - // type: 'string', - // title: 'Store path', - // description: 'GitHub store path in org/repo format', - // }, - // }, - // }, - // }, - // }; - // it('should throw an error when the preparer for the source location is not registered', () => { - // const preparers = new Preparers(); - - // expect(() => preparers.get(mockTemplate)).toThrow( - // expect.objectContaining({ - // message: 'No preparer registered for type: "file"', - // }), - // ); - // }); - // it('should return the correct preparer when the source matches', () => { - // const preparers = new Preparers(); - // const preparer = new FilePreparer(); - - // preparers.register('file', preparer); - - // expect(preparers.get(mockTemplate)).toBe(preparer); - // }); - - // it('should throw an error if the metadata tag does not exist in the entity', () => { - // const brokenTemplate: TemplateEntityV1alpha1 = { - // apiVersion: 'backstage.io/v1alpha1', - // kind: 'Template', - // metadata: { - // annotations: {}, - // name: 'react-ssr-template', - // title: 'React SSR Template', - // description: - // 'Next.js application skeleton for creating isomorphic web applications.', - // uid: '7357f4c5-aa58-4a1e-9670-18931eef771f', - // etag: 'YWUxZWQyY2EtZDkxMC00MDM0LWI0ODAtMDgwMWY0YzdlMWIw', - // generation: 1, - // }, - // spec: { - // type: 'website', - // templater: 'cookiecutter', - // path: '.', - // schema: { - // $schema: 'http://json-schema.org/draft-07/schema#', - // required: ['storePath', 'owner'], - // properties: { - // owner: { - // type: 'string', - // title: 'Owner', - // description: 'Who is going to own this component', - // }, - // storePath: { - // type: 'string', - // title: 'Store path', - // description: 'GitHub store path in org/repo format', - // }, - // }, - // }, - // }, - // }; - - // const preparers = new Preparers(); - - // expect(() => preparers.get(brokenTemplate)).toThrow( - // expect.objectContaining({ - // message: expect.stringContaining('No location annotation provided'), - // }), - // ); - // }); - it('should return the correct preparer based on the hostname', async () => { const preparer = new GithubPreparer( new ConfigReader({