From 3807aff6aff3aeb535fa25624111bfbec775d5a5 Mon Sep 17 00:00:00 2001 From: Kamil Pajdzik <41709775+kpajdzik@users.noreply.github.com> Date: Fri, 10 May 2019 09:39:56 -0700 Subject: [PATCH] Extract userAgent variable to fix tests in Azure DevOps CI/CD (#107) * Add cast to any * Extract userAgent * Reset package.json --- test/azureServiceClientTests.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/azureServiceClientTests.ts b/test/azureServiceClientTests.ts index a4049b594889..44758e4aa44f 100644 --- a/test/azureServiceClientTests.ts +++ b/test/azureServiceClientTests.ts @@ -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;