MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / drain

Function drain

test/unit/session_composition_test.js:21–31  ·  view source on GitHub ↗
(times = 5, ms = 700)

Source from the content-addressed store, hash-verified

19// (added while the chain runs) are surfaced. Returns the last error seen, or
20// undefined if the chain settled cleanly.
21async function drain(times = 5, ms = 700) {
22 let err
23 for (let i = 0; i < times; i++) {
24 try {
25 await settles(Promise.resolve(recorder.promise()), ms)
26 } catch (e) {
27 err = e
28 }
29 }
30 return err
31}
32
33function makeFakeHelper() {
34 const calls = { start: 0, stop: 0, loadVars: 0, restoreVars: 0, withinBegin: 0, withinEnd: 0 }

Callers 1

Calls 1

settlesFunction · 0.70

Tested by

no test coverage detected