File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -68,14 +68,12 @@ describe("Heart", () => {
68
68
const isAlive = heart . alive ( )
69
69
expect ( isAlive ) . toBe ( false )
70
70
} )
71
- it ( "should beat twice and maintain reference to Heart " , async ( ) => {
71
+ it ( "should beat twice without warnings " , async ( ) => {
72
72
// Use fake timers so we can speed up setTimeout
73
73
jest . useFakeTimers ( )
74
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
75
+ await heart . beat ( )
76
+ // Speed up clocks so this.heartbeatTimer is called after .beat()
79
77
jest . runAllTimers ( )
80
78
expect ( logger . warn ) . not . toHaveBeenCalled ( )
81
79
} )
You can’t perform that action at this time.
0 commit comments