({
timeout = DEFAULT_TIMEOUT
}: WaitForNextUpdateOptions = {})
| 73 | } |
| 74 | |
| 75 | const waitForNextUpdate = async ({ |
| 76 | timeout = DEFAULT_TIMEOUT |
| 77 | }: WaitForNextUpdateOptions = {}) => { |
| 78 | let updated = false |
| 79 | addResolver(() => { |
| 80 | updated = true |
| 81 | }) |
| 82 | |
| 83 | const result = await wait(() => updated, { interval: false, timeout }) |
| 84 | if (!result && timeout) { |
| 85 | throw new TimeoutError(waitForNextUpdate, timeout) |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | return { |
| 90 | waitFor, |
no test coverage detected
searching dependent graphs…