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
9 changes: 8 additions & 1 deletion src/commands/project/create-variable-group.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,14 @@ describe("create", () => {
personalAccessToken,
project: devopsProject,
};
await expect(create("", "", "", "", "", "", accessOpts)).rejects.toThrow();

// for some reasons, cannot get the await expect(...).rejects.toThrow() to work
try {
await create("", "", "", "", "", "", accessOpts);
expect(true).toBeFalsy();
} catch (e) {
expect(e.message).toBe("Required values were missing");
}
});

test("Should pass with variable group arguments", async () => {
Expand Down
10 changes: 10 additions & 0 deletions src/commands/project/create-variable-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,16 @@ export const create = (
`Creating Variable Group from group definition '${variableGroupName}'`
);

if (
!registryName ||
!hldRepoUrl ||
!servicePrincipalId ||
!servicePrincipalPassword ||
!tenantId
) {
throw Error("Required values were missing");
}

const vars: VariableGroupDataVariable = {
ACR_NAME: {
value: registryName,
Expand Down