Skip to content
This repository has been archived by the owner on Apr 13, 2020. It is now read-only.

Commit

Permalink
[HOUSEKEEPING] remove unused serviceName parameter in installBuildUpd…
Browse files Browse the repository at this point in the history
…atePipeline (#401)

Co-authored-by: Michael Tarng <20913254+mtarng@users.noreply.github.com>
  • Loading branch information
dennisseah and mtarng authored Mar 16, 2020
1 parent 55e9cca commit 88dfc1c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 22 deletions.
24 changes: 4 additions & 20 deletions src/commands/service/pipeline.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/commands/service/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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<void> => {
Expand Down

0 comments on commit 88dfc1c

Please sign in to comment.