mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00: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
Notes:
github-actions[bot]
2025-02-05 20:28:23 +00:00
Author: https://github.com/rmg-x
Commit: 0de910784e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3270
Reviewed-by: https://github.com/ADKaster ✅
1 changed files with 4 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue