|
| 1 | +import ShutdownManager from "./shutdownManager"; |
| 2 | + |
| 3 | +describe("ShutdownManager", () => { |
| 4 | + describe("constructor", () => { |
| 5 | + it("should create a new instance", () => { |
| 6 | + const instance = new ShutdownManager(); |
| 7 | + expect(instance).toBeInstanceOf(ShutdownManager); |
| 8 | + }); |
| 9 | + |
| 10 | + it("should set isShuttingDown to the provided value", () => { |
| 11 | + const instance = new ShutdownManager(true); |
| 12 | + expect(instance["isShuttingDown"]).toBe(true); |
| 13 | + }); |
| 14 | + |
| 15 | + it("should set isShuttingDown to false if no value is provided", () => { |
| 16 | + const instance = new ShutdownManager(); |
| 17 | + expect(instance["isShuttingDown"]).toBe(false); |
| 18 | + }); |
| 19 | + }); |
| 20 | + |
| 21 | + describe("getIsShuttingDown", () => { |
| 22 | + it("should return true when isShuttingDown is true", () => { |
| 23 | + const instance = new ShutdownManager(true); |
| 24 | + expect(instance.getIsShuttingDown()).toBe(true); |
| 25 | + }); |
| 26 | + |
| 27 | + it("should return false when isShuttingDown is false", () => { |
| 28 | + const instance = new ShutdownManager(false); |
| 29 | + expect(instance.getIsShuttingDown()).toBe(false); |
| 30 | + }); |
| 31 | + }); |
| 32 | + |
| 33 | + describe("triggerShutdown", () => { |
| 34 | + it.todo("should set isShuttingDown to true"); |
| 35 | + }); |
| 36 | +}); |
0 commit comments