mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
Tests/LibWeb: Finish async test when an error is caught
This catches errors that occur within async tests so that we fail faster rather than timing out due to `done()` not being called. We use `Promise.resolve()` because `f` isn't guaranteed to be an async function.
This commit is contained in:
parent
9f7bdaf3b4
commit
0de910784e
|
|
@ -86,7 +86,10 @@ function asyncTest(f) {
|
|||
__finishTest();
|
||||
};
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
f(done);
|
||||
Promise.resolve(f(done)).catch(error => {
|
||||
println(`Caught error while running async test: ${error}`);
|
||||
done();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user