Skip to content

Commit

Permalink
Update error messages in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ramya-rao-a committed Feb 17, 2021
1 parent 021ab83 commit 9f3094c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
9 changes: 5 additions & 4 deletions sdk/eventhub/event-hubs/test/internal/sender.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { AbortController } from "@azure/abort-controller";
import { SpanGraph, TestSpan } from "@azure/core-tracing";
import { TRACEPARENT_PROPERTY } from "../../src/diagnostics/instrumentEventData";
import { SubscriptionHandlerForTests } from "../public/utils/subscriptionHandlerForTests";
import { StandardAbortMessage } from "../../src/util/timeoutAbortSignalUtils";
const env = getEnvVars();

describe("EventHub Sender", function(): void {
Expand Down Expand Up @@ -483,7 +484,7 @@ describe("EventHub Sender", function(): void {
throw new Error(`Test failure`);
} catch (err) {
err.name.should.equal("AbortError");
err.message.should.equal("The create batch operation has been cancelled by the user.");
err.message.should.equal(StandardAbortMessage);
}
});

Expand All @@ -497,7 +498,7 @@ describe("EventHub Sender", function(): void {
throw new Error(`Test failure`);
} catch (err) {
err.name.should.equal("AbortError");
err.message.should.equal("The create batch operation has been cancelled by the user.");
err.message.should.equal(StandardAbortMessage);
}
});
});
Expand Down Expand Up @@ -976,7 +977,7 @@ describe("EventHub Sender", function(): void {
throw new Error(`Test failure`);
} catch (err) {
err.name.should.equal("AbortError");
err.message.should.equal("The send operation has been cancelled by the user.");
err.message.should.equal(StandardAbortMessage);
}
});

Expand All @@ -996,7 +997,7 @@ describe("EventHub Sender", function(): void {
throw new Error(`Test failure`);
} catch (err) {
err.name.should.equal("AbortError");
err.message.should.equal("The send operation has been cancelled by the user.");
err.message.should.equal(StandardAbortMessage);
}
});

Expand Down
12 changes: 6 additions & 6 deletions sdk/eventhub/event-hubs/test/public/hubruntime.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ describe("RuntimeInformation", function(): void {
});
throw new Error(`Test failure`);
} catch (err) {
err.message.should.match(/The [\w]+ operation has been cancelled by the user.$/gi);
err.message.should.equal("The operation was aborted.");
}
});

Expand All @@ -88,7 +88,7 @@ describe("RuntimeInformation", function(): void {
});
throw new Error(`Test failure`);
} catch (err) {
err.message.should.match(/The [\w]+ operation has been cancelled by the user.$/gi);
err.message.should.equal("The operation was aborted.");
}
});

Expand Down Expand Up @@ -201,7 +201,7 @@ describe("RuntimeInformation", function(): void {
});
throw new Error(`Test failure`);
} catch (err) {
err.message.should.match(/The [\w]+ operation has been cancelled by the user.$/gi);
err.message.should.equal("The operation was aborted.");
}
});

Expand All @@ -216,7 +216,7 @@ describe("RuntimeInformation", function(): void {
});
throw new Error(`Test failure`);
} catch (err) {
err.message.should.match(/The [\w]+ operation has been cancelled by the user.$/gi);
err.message.should.equal("The operation was aborted.");
}
});

Expand Down Expand Up @@ -413,7 +413,7 @@ describe("RuntimeInformation", function(): void {
});
throw new Error(`Test failure`);
} catch (err) {
err.message.should.match(/The [\w]+ operation has been cancelled by the user.$/gi);
err.message.should.equal("The operation was aborted.");
}
});

Expand All @@ -428,7 +428,7 @@ describe("RuntimeInformation", function(): void {
});
throw new Error(`Test failure`);
} catch (err) {
err.message.should.match(/The [\w]+ operation has been cancelled by the user.$/gi);
err.message.should.equal("The operation was aborted.");
}
});

Expand Down

0 comments on commit 9f3094c

Please sign in to comment.