Function
waitUntil
(predicate, timeout = 2000, interval = 50)
Source from the content-addressed store, hash-verified
| 21 | } |
| 22 | |
| 23 | async function waitUntil(predicate, timeout = 2000, interval = 50) { |
| 24 | const start = Date.now(); |
| 25 | while (Date.now() - start < timeout) { |
| 26 | if (await predicate()) { |
| 27 | return; |
| 28 | } |
| 29 | await delay(interval); |
| 30 | } |
| 31 | throw new Error("Timed out waiting for condition"); |
| 32 | } |
| 33 | |
| 34 | test("compiles a single Mirrow file and appends the .svg extension", async () => { |
| 35 | const root = await createTempDir("single"); |
Tested by
no test coverage detected