Skip to content

Commit

Permalink
test: check if 'createHeaders' overwrite the 'user-agent' header
Browse files Browse the repository at this point in the history
  • Loading branch information
SofianD committed Jun 19, 2024
1 parent 13f0b6b commit 0c83afe
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ describe("createHeaders", () => {
expect(result).toEqual({ foo: "bar", "user-agent": "httpie" });
});

it("should overwrite the 'user-agent' header", () => {
const result = Utils.createHeaders({
headers: { "user-agent": "myUserAgent" }
});

expect(result).toEqual({ "user-agent": "myUserAgent" });
});

it("should add authorization header (and override original property)", () => {
const result = Utils.createHeaders({
headers: {
Expand Down

0 comments on commit 0c83afe

Please sign in to comment.