yzt
2023-09-27 726603df43447f8cfedfeaae4267209adbd01699
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
27
import { deprecationWarning } from "../../Source/Cesium.js";
 
describe("Core/deprecationWarning", function () {
  it("logs a warning", function () {
    spyOn(console, "warn");
 
    deprecationWarning("deprecation-identifier", "message");
    deprecationWarning("deprecation-identifier", "message");
    deprecationWarning("another deprecation-identifier", "another message");
 
    expect(console.warn.calls.count()).toEqual(2);
    expect(console.warn.calls.argsFor(0)[0]).toBe("message");
    expect(console.warn.calls.argsFor(1)[0]).toBe("another message");
  });
 
  it("throws without identifier", function () {
    expect(function () {
      deprecationWarning();
    }).toThrowDeveloperError();
  });
 
  it("throws without message", function () {
    expect(function () {
      deprecationWarning("identifier");
    }).toThrowDeveloperError();
  });
});