yzt
2023-05-26 2f70f6727314edd84d8ec2bfe3ce832803f1ea77
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { oneTimeWarning } from "../../Source/Cesium.js";
 
describe("Core/oneTimeWarning", function () {
  it("logs a warning", function () {
    spyOn(console, "warn");
 
    oneTimeWarning("oneTime-identifier", "message");
    oneTimeWarning("oneTime-identifier");
    oneTimeWarning("another oneTime-identifier");
 
    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 oneTime-identifier");
  });
 
  it("throws without identifier", function () {
    expect(function () {
      oneTimeWarning();
    }).toThrowDeveloperError();
  });
});