Lines Matching refs:timers
12 const timers = new Timers(options) constant
13 t.teardown(() => timers.off())
14 return { timers, logs }
18 const { timers } = mockTimers(t)
19 t.match(timers.unfinished, new Map())
20 t.match(timers.finished, {})
24 const { timers } = mockTimers(t)
28 t.match(timers.unfinished, new Map([['foo', Number]]))
29 t.match(timers.finished, { bar: Number })
30 timers.off()
32 t.notOk(timers.unfinished.get('baz'))
36 const { timers } = mockTimers(t)
38 const end = timers.time('later')
39 timers.time('sync', () => {})
40 await timers.time('async', () => new Promise(r => setTimeout(r, 10)))
43 t.match(timers.finished, { later: Number, sync: Number, async: Number })
47 const { timers } = mockTimers(t, { start: 'foo' })
49 t.match(timers.finished, { foo: Number })
55 const { timers } = mockTimers(t, { listener })
59 timers.off(listener)
72 const { timers } = mockTimers(t)
76 timers.load({ path: resolve(dir, `TIMING_FILE-`) })
77 timers.writeFile({ some: 'data' })
81 timers: { foo: Number }, property
89 const { logs, timers } = mockTimers(t)
92 timers.load({ path: join(dir, 'does', 'not', 'exist') })
93 timers.writeFile()
96 t.equal(timers.file, null)
100 const { logs, timers } = mockTimers(t)
102 timers.load()
103 timers.writeFile()
106 t.equal(timers.file, null)