From 611935e40315a5f79a7a0fcd84525213ffbd1874 Mon Sep 17 00:00:00 2001 From: Dennis Seah Date: Fri, 13 Mar 2020 17:19:22 -0700 Subject: [PATCH] [HOUSEKEEPING] remove unused serviceName parameter in installBuildUpdatePipeline --- src/commands/service/pipeline.test.ts | 24 ++++-------------------- src/commands/service/pipeline.ts | 3 +-- 2 files changed, 5 insertions(+), 22 deletions(-) diff --git a/src/commands/service/pipeline.test.ts b/src/commands/service/pipeline.test.ts index 8abf0268d..97d1e5294 100644 --- a/src/commands/service/pipeline.test.ts +++ b/src/commands/service/pipeline.test.ts @@ -118,22 +118,14 @@ describe("required pipeline variables", () => { describe("create pipeline tests", () => { it("should create a pipeline", async () => { (createPipelineForDefinition as jest.Mock).mockReturnValueOnce({ id: 10 }); - await installBuildUpdatePipeline( - "serviceName", - "/path/to/yaml", - MOCKED_VALUES - ); + await installBuildUpdatePipeline("/path/to/yaml", MOCKED_VALUES); }); it("should fail if the build client cant be instantiated", async () => { (getBuildApiClient as jest.Mock).mockReturnValueOnce(Promise.reject()); try { - await installBuildUpdatePipeline( - "serviceName", - "/path/to/yaml", - MOCKED_VALUES - ); + await installBuildUpdatePipeline("/path/to/yaml", MOCKED_VALUES); expect(true).toBe(false); } catch (_) { // expecting exception to be thrown @@ -147,11 +139,7 @@ describe("create pipeline tests", () => { ); try { - await installBuildUpdatePipeline( - "serviceName", - "/path/to/yaml", - MOCKED_VALUES - ); + await installBuildUpdatePipeline("/path/to/yaml", MOCKED_VALUES); expect(true).toBe(false); } catch (_) { // expecting exception to be thrown @@ -164,11 +152,7 @@ describe("create pipeline tests", () => { (queueBuild as jest.Mock).mockReturnValueOnce(Promise.reject()); try { - await installBuildUpdatePipeline( - "serviceName", - "/path/to/yaml", - MOCKED_VALUES - ); + await installBuildUpdatePipeline("/path/to/yaml", MOCKED_VALUES); expect(true).toBe(false); } catch (_) { // expecting exception to be thrown diff --git a/src/commands/service/pipeline.ts b/src/commands/service/pipeline.ts index 18f2a5b93..b9370c9dc 100644 --- a/src/commands/service/pipeline.ts +++ b/src/commands/service/pipeline.ts @@ -96,7 +96,7 @@ export const execute = async ( opts.repoName, accessOpts ); - await installBuildUpdatePipeline(serviceName, pipelinesYamlPath, opts); + await installBuildUpdatePipeline(pipelinesYamlPath, opts); await exitFn(0); } catch (err) { logger.error(err); @@ -124,7 +124,6 @@ export const commandDecorator = (command: commander.Command): void => { * @param values Values from commander */ export const installBuildUpdatePipeline = async ( - serviceName: string, pipelinesYamlPath: string, values: CommandOptions ): Promise => {