Skip to content

Commit 4cbfc0a

Browse files
committed
Add try/catch for waitForFunction callback
1 parent 10e0e80 commit 4cbfc0a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/helpers/wait-for.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@ export function waitForFunction(fn, arg, options = {}) {
2121
let timeElapsed = 0;
2222

2323
const int = setInterval(() => {
24-
const result = fn(arg);
24+
let result;
25+
26+
try {
27+
result = fn(arg);
28+
} catch (e) {
29+
// Continue...
30+
}
2531

2632
if (result) {
2733
clearInterval(int);

0 commit comments

Comments
 (0)