mirror of
https://github.com/coder/code-server.git
synced 2026-06-18 16:07:11 +02:00
fix: re-enable skipped Heart tests and make non-asserting checks assert (#7845)
This commit is contained in:
committed by
GitHub
parent
72086edbdb
commit
7dfd68589a
@@ -115,6 +115,9 @@ describe("heartbeatTimer", () => {
|
||||
const heart = new Heart(`${testDir}/shutdown.txt`, mockIsActive)
|
||||
await heart.beat()
|
||||
jest.advanceTimersByTime(60 * 1000)
|
||||
// Yield a real macrotask so the callback's rejection handler can run first
|
||||
// (fake timers stub the global setImmediate).
|
||||
await new Promise((resolve) => jest.requireActual("timers").setImmediate(resolve))
|
||||
|
||||
expect(mockIsActive).toHaveBeenCalled()
|
||||
expect(logger.warn).toHaveBeenCalledWith(errorMsg)
|
||||
@@ -147,7 +150,7 @@ describe("stateChange", () => {
|
||||
|
||||
expect(mockOnChange.mock.calls[0][0]).toBe("alive")
|
||||
})
|
||||
it.only("should change to expired when not active", async () => {
|
||||
it("should change to expired when not active", async () => {
|
||||
jest.useFakeTimers()
|
||||
heart = new Heart(`${testDir}/shutdown.txt`, () => new Promise((resolve) => resolve(false)))
|
||||
const mockOnChange = jest.fn()
|
||||
|
||||
Reference in New Issue
Block a user