We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent be3231e commit dd2829aCopy full SHA for dd2829a
test/unit/node/heart.test.ts
@@ -68,14 +68,12 @@ describe("Heart", () => {
68
const isAlive = heart.alive()
69
expect(isAlive).toBe(false)
70
})
71
- it("should beat twice and maintain reference to Heart", async () => {
+ it("should beat twice without warnings", async () => {
72
// Use fake timers so we can speed up setTimeout
73
jest.useFakeTimers()
74
heart = new Heart(`${testDir}/hello.txt`, mockIsActive(true))
75
- heart.beat()
76
- // we need to speed up clocks, timeouts
77
- // call heartbeat again (and it won't be alive I think)
78
- // then assert no warnings were called
+ await heart.beat()
+ // Speed up clocks so this.heartbeatTimer is called after .beat()
79
jest.runAllTimers()
80
expect(logger.warn).not.toHaveBeenCalled()
81
0 commit comments