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

Commit

Permalink
Two changes for Sprint 122 (#300)
Browse files Browse the repository at this point in the history
* Add unit test for #291 (ensuring domain is used with ArgumentBuilder)

* Ensure we log an exception when 'Device Flow' fails
  • Loading branch information
Jeff Young authored Aug 10, 2017
1 parent a6e659b commit 0cf9ac5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/team-extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,8 @@ export class TeamExtension {
if (err.message) {
msg = `${msg} (${err.message})`;
}
Logger.LogError(msg);
//FUTURE: Add a ButtonMessageItem to provide additional help? Log a bug?
VsCodeUtils.ShowErrorMessage(msg);
this._manager.ReportError(err, msg, true);
}
this._signingIn = false;
}
Expand Down
13 changes: 13 additions & 0 deletions test/tfvc/commands/argumentbuilder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,19 @@ describe("Tfvc-ArgumentBuilder", function() {
assert.equal(args.length, 4);
});

it("should verify constructor with context - user and domain", function() {
context.CredentialInfo = new CredentialInfo(user, pass, "domain", "workstation");
const cmd: string = "mycmd";
const builder: ArgumentBuilder = new ArgumentBuilder(cmd, context);
assert.equal(builder.GetCommand(), cmd);
const args = builder.Build();
assert.equal(args[0], cmd);
assert.equal(args[1], "-noprompt");
assert.equal(args[2], "-collection:" + collectionUrl);
assert.equal(args[3], "-login:" + `domain\\${user}` + "," + pass);
assert.equal(args.length, 4);
});

it("should verify constructor error", function() {
assert.throws(() => new ArgumentBuilder(undefined), TfvcError, /Argument is required/);
});
Expand Down

0 comments on commit 0cf9ac5

Please sign in to comment.