Skip to content

Commit 0856707

Browse files
add testcase
1 parent bd1c875 commit 0856707

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

test/requestTracing.test.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ describe("request tracing", function () {
7777
expect(correlationContext.includes("UsesKeyVault")).eq(true);
7878
});
7979

80-
it("should have cdn tag in correlation-context header", async () => {
80+
it("should have cdn tag in correlation-context header when loadFromCdn is used", async () => {
8181
try {
8282
await loadFromCdn(fakeEndpoint, {
8383
clientOptions
@@ -89,6 +89,18 @@ describe("request tracing", function () {
8989
expect(correlationContext.includes("CDN")).eq(true);
9090
});
9191

92+
it("should not have cdn tag in correlation-context header when load is used", async () => {
93+
try {
94+
await load(createMockedConnectionString(fakeEndpoint), {
95+
clientOptions
96+
});
97+
} catch (e) { /* empty */ }
98+
expect(headerPolicy.headers).not.undefined;
99+
const correlationContext = headerPolicy.headers.get("Correlation-Context");
100+
expect(correlationContext).not.undefined;
101+
expect(correlationContext.includes("CDN")).eq(false);
102+
});
103+
92104
it("should detect env in correlation-context header", async () => {
93105
process.env.NODE_ENV = "development";
94106
try {

0 commit comments

Comments
 (0)