Skip to content

Commit

Permalink
Extract userAgent variable to fix tests in Azure DevOps CI/CD (Azure#107
Browse files Browse the repository at this point in the history
)

* Add cast to any

* Extract userAgent

* Reset package.json
  • Loading branch information
kpajdzik authored May 10, 2019
1 parent f75b08d commit 3807aff
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/azureServiceClientTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2514,10 +2514,12 @@ describe("AzureServiceClient", () => {
describe("updateOptionsWithDefaultValues()", () => {
function assertOptionEqual(actual: AzureServiceClientOptions, expected: AzureServiceClientOptions) {
let actualUserAgent: string | undefined;
if (typeof actual.userAgent === "string") {
actualUserAgent = actual.userAgent;
const userAgent: string | ((defaultUserAgent: string) => string) = actual.userAgent!;

if (typeof userAgent === "string") {
actualUserAgent = userAgent;
} else if (typeof actual.userAgent === "function") {
actualUserAgent = actual.userAgent("");
actualUserAgent = userAgent("");
}
delete actual.userAgent;
delete expected.userAgent;
Expand Down

0 comments on commit 3807aff

Please sign in to comment.