From 0c6d01997eb66353562d8dde61d805c4758eaafc Mon Sep 17 00:00:00 2001 From: Jonathan Cardenas Date: Tue, 14 Dec 2021 15:17:16 -0800 Subject: [PATCH] Removing type validation for errors --- .../app-configuration/test/internal/tracingHelpers.spec.ts | 3 --- .../app-configuration/test/public/utils/testHelpers.ts | 7 ------- 2 files changed, 10 deletions(-) diff --git a/sdk/appconfiguration/app-configuration/test/internal/tracingHelpers.spec.ts b/sdk/appconfiguration/app-configuration/test/internal/tracingHelpers.spec.ts index e73df9270121..06c1c2414016 100644 --- a/sdk/appconfiguration/app-configuration/test/internal/tracingHelpers.spec.ts +++ b/sdk/appconfiguration/app-configuration/test/internal/tracingHelpers.spec.ts @@ -92,9 +92,6 @@ describe("tracingHelpers", () => { assert.fail("Exception should have been thrown from `trace` since the inner action threw"); } catch (err) { - if (!(err instanceof Error)) { - throw new Error("Error is not recognized"); - } assert.equal(err.message, "Purposefully thrown error"); } diff --git a/sdk/appconfiguration/app-configuration/test/public/utils/testHelpers.ts b/sdk/appconfiguration/app-configuration/test/public/utils/testHelpers.ts index 621732b5aa6c..2288c40b6728 100644 --- a/sdk/appconfiguration/app-configuration/test/public/utils/testHelpers.ts +++ b/sdk/appconfiguration/app-configuration/test/public/utils/testHelpers.ts @@ -18,7 +18,6 @@ import { import { assert } from "chai"; import { DefaultAzureCredential, TokenCredential } from "@azure/identity"; -import { RestError } from "@azure/core-http"; let connectionStringNotPresentWarning = false; let tokenCredentialsNotPresentWarning = false; @@ -163,9 +162,6 @@ export async function assertThrowsRestError( await testFunction(); assert.fail(`${message}: No error thrown`); } catch (err) { - if (!(err instanceof RestError)) { - throw new Error("Error is not recognized"); - } if (err.name === "RestError") { assert.equal(expectedStatusCode, err.statusCode, message); return err; @@ -185,9 +181,6 @@ export async function assertThrowsAbortError( await testFunction(); assert.fail(`${message}: No error thrown`); } catch (e) { - if (!(e instanceof Error)) { - throw new Error("Error is not recognized"); - } if (isPlaybackMode() && (e.name === "FetchError" || e.name === "AbortError")) { return e; } else {