diff --git a/aio/aio-builds-setup/dockerbuild/scripts-js/lib/upload-server/build-events.ts b/aio/aio-builds-setup/dockerbuild/scripts-js/lib/upload-server/build-events.ts index b1d8b17bbf..60f133e04f 100644 --- a/aio/aio-builds-setup/dockerbuild/scripts-js/lib/upload-server/build-events.ts +++ b/aio/aio-builds-setup/dockerbuild/scripts-js/lib/upload-server/build-events.ts @@ -1,15 +1,8 @@ // Classes -export class BuildEvent { - // Constructor - constructor(public type: string, public pr: number, public sha: string) {} -} - -export class CreatedBuildEvent extends BuildEvent { +export class CreatedBuildEvent { // Properties - Public, Static public static type = 'build.created'; // Constructor - constructor(pr: number, sha: string) { - super(CreatedBuildEvent.type, pr, sha); - } + constructor(public pr: number, public sha: string) {} } diff --git a/aio/aio-builds-setup/dockerbuild/scripts-js/test/upload-server/build-events.spec.ts b/aio/aio-builds-setup/dockerbuild/scripts-js/test/upload-server/build-events.spec.ts index 868e6ce352..43d622e478 100644 --- a/aio/aio-builds-setup/dockerbuild/scripts-js/test/upload-server/build-events.spec.ts +++ b/aio/aio-builds-setup/dockerbuild/scripts-js/test/upload-server/build-events.spec.ts @@ -1,30 +1,7 @@ // Imports -import {BuildEvent, CreatedBuildEvent} from '../../lib/upload-server/build-events'; +import {CreatedBuildEvent} from '../../lib/upload-server/build-events'; // Tests -describe('BuildEvent', () => { - let evt: BuildEvent; - - beforeEach(() => evt = new BuildEvent('foo', 42, 'bar')); - - - it('should have a \'type\' property', () => { - expect(evt.type).toBe('foo'); - }); - - - it('should have a \'pr\' property', () => { - expect(evt.pr).toBe(42); - }); - - - it('should have a \'sha\' property', () => { - expect(evt.sha).toBe('bar'); - }); - -}); - - describe('CreatedBuildEvent', () => { let evt: CreatedBuildEvent; @@ -36,19 +13,6 @@ describe('CreatedBuildEvent', () => { }); - it('should extend BuildEvent', () => { - expect(evt).toEqual(jasmine.any(CreatedBuildEvent)); - expect(evt).toEqual(jasmine.any(BuildEvent)); - - expect(Object.getPrototypeOf(evt)).toBe(CreatedBuildEvent.prototype); - }); - - - it('should automatically set the \'type\'', () => { - expect(evt.type).toBe(CreatedBuildEvent.type); - }); - - it('should have a \'pr\' property', () => { expect(evt.pr).toBe(42); });