From 17d5bba990e14846b8016859b5c509a4a552c5ac Mon Sep 17 00:00:00 2001 From: Kamil Pajdzik <41709775+kpajdzik@users.noreply.github.com> Date: Fri, 10 May 2019 09:50:51 -0700 Subject: [PATCH] Add userAgent casting (#108) --- test/azureServiceClientTests.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/azureServiceClientTests.ts b/test/azureServiceClientTests.ts index 44758e4aa44f..7357583271b5 100644 --- a/test/azureServiceClientTests.ts +++ b/test/azureServiceClientTests.ts @@ -2514,12 +2514,11 @@ describe("AzureServiceClient", () => { describe("updateOptionsWithDefaultValues()", () => { function assertOptionEqual(actual: AzureServiceClientOptions, expected: AzureServiceClientOptions) { let actualUserAgent: string | undefined; - const userAgent: string | ((defaultUserAgent: string) => string) = actual.userAgent!; - if (typeof userAgent === "string") { - actualUserAgent = userAgent; + if (typeof actual.userAgent === "string") { + actualUserAgent = (actual.userAgent! as string); } else if (typeof actual.userAgent === "function") { - actualUserAgent = userAgent(""); + actualUserAgent = (actual.userAgent! as ((defaultUserAgent: string) => string))(""); } delete actual.userAgent; delete expected.userAgent;