-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: change LF to CRLF symbol in getAllResponseHeaders facade's method (
#163) * fix: change LF to CRLF symbol in getAllResponseHeaders facade's method * fix: resolve prettier errors * fix: resolve prettier errors * fix: resolve prettier errors --------- Co-authored-by: Aleksey Ivasyuta <[email protected]>
- Loading branch information
1 parent
b8cf047
commit 8853473
Showing
3 changed files
with
73 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { test, expect } from "@playwright/test"; | ||
import headers from "../src/misc/headers"; | ||
|
||
const CRLF = "\r\n"; | ||
|
||
const headersObj = { | ||
"cache-control": "no-cache", | ||
"content-encoding": "gzip", | ||
"content-type": "multipart/mixed", | ||
}; | ||
|
||
const headersString = `cache-control: no-cache${CRLF}content-encoding: gzip${CRLF}content-type: multipart/mixed`; | ||
|
||
test.describe("convert helper", function () { | ||
test("object to string", () => { | ||
const result = headers.convert(headersObj); | ||
expect(result).toEqual(headersString); | ||
}); | ||
|
||
test("string to object", () => { | ||
const result = headers.convert(headersString); | ||
expect(result).toEqual(headersObj); | ||
}); | ||
|
||
test("add result to dest when object", () => { | ||
const result = {}; | ||
headers.convert(headersString, result); | ||
expect(result).toEqual(headersObj); | ||
}); | ||
|
||
test("converts header name to lowercase", () => { | ||
const result = headers.convert({ Foo: "Bar" }); | ||
expect(result).toEqual("foo: Bar"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters