tests: Accept async condition functions for helper.waitFor()

This commit is contained in:
Richard Hansen 2021-02-13 00:02:25 -05:00 committed by John McLear
parent 8dca4cb16f
commit 09e9c36098
2 changed files with 15 additions and 2 deletions

View file

@ -211,9 +211,9 @@ const helper = {};
return _fail(...args);
};
const check = () => {
const check = async () => {
try {
if (!conditionFunc()) return;
if (!await conditionFunc()) return;
deferred.resolve();
} catch (err) {
deferred.reject(err);