(
selector: () => unknown,
{ interval = DEFAULT_INTERVAL, timeout = DEFAULT_TIMEOUT }: WaitForValueToChangeOptions = {}
)
| 61 | } |
| 62 | |
| 63 | const waitForValueToChange = async ( |
| 64 | selector: () => unknown, |
| 65 | { interval = DEFAULT_INTERVAL, timeout = DEFAULT_TIMEOUT }: WaitForValueToChangeOptions = {} |
| 66 | ) => { |
| 67 | const initialValue = selector() |
| 68 | |
| 69 | const result = await wait(() => selector() !== initialValue, { interval, timeout }) |
| 70 | if (!result && timeout) { |
| 71 | throw new TimeoutError(waitForValueToChange, timeout) |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | const waitForNextUpdate = async ({ |
| 76 | timeout = DEFAULT_TIMEOUT |
no test coverage detected
searching dependent graphs…