Skip to content
This repository was archived by the owner on Apr 13, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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