yzt
2023-05-05 634ab285812bcc3eb802cacb9ec54f489bc2728f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { RequestErrorEvent } from "../../Source/Cesium.js";
 
describe("Core/RequestErrorEvent", function () {
  it("parses response headers provided as a string", function () {
    var event = new RequestErrorEvent(
      404,
      "foo",
      "This-is-a-test: first\r\nAnother: second value!"
    );
    expect(event.responseHeaders).toEqual({
      "This-is-a-test": "first",
      Another: "second value!",
    });
  });
 
  it("leaves the response headers alone if they're already specified as an object literal", function () {
    var event = new RequestErrorEvent(404, "foo", {
      "This-is-a-test": "first",
      Another: "second value!",
    });
    expect(event.responseHeaders).toEqual({
      "This-is-a-test": "first",
      Another: "second value!",
    });
  });
});