diff --git a/sdk/appconfiguration/app-configuration/test/public/utils/testHelpers.ts b/sdk/appconfiguration/app-configuration/test/public/utils/testHelpers.ts index 621732b5aa6c..0b143d59669c 100644 --- a/sdk/appconfiguration/app-configuration/test/public/utils/testHelpers.ts +++ b/sdk/appconfiguration/app-configuration/test/public/utils/testHelpers.ts @@ -163,11 +163,12 @@ export async function assertThrowsRestError( await testFunction(); assert.fail(`${message}: No error thrown`); } catch (err) { - if (!(err instanceof RestError)) { + if (!(err instanceof Error)) { throw new Error("Error is not recognized"); } if (err.name === "RestError") { - assert.equal(expectedStatusCode, err.statusCode, message); + const restError = err as RestError; + assert.equal(expectedStatusCode, restError.statusCode, message); return err; }