diff --git a/Userland/Libraries/LibJS/Tests/syntax/async-await.js b/Userland/Libraries/LibJS/Tests/syntax/async-await.js index d86c9eea8e..d5d8b469f8 100644 --- a/Userland/Libraries/LibJS/Tests/syntax/async-await.js +++ b/Userland/Libraries/LibJS/Tests/syntax/async-await.js @@ -200,3 +200,15 @@ describe("await cannot be used in class static init blocks", () => { expect("class A{ static { async function* await() {} } }").not.toEval(); }); }); + +test("async returning a thenable", () => { + let isCalled = false; + const f = async () => ({ + then() { + isCalled = true; + }, + }); + f(); + runQueuedPromiseJobs(); + expect(isCalled).toBe(true); +});