yzt
2023-05-26 de4278af2fd46705a40bac58ec01122db6b7f3d7
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!",
    });
  });
});