mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 17:38:12 +00:00
LibJS/Tests: Add a test for an async function which returns a thenable
This test passes when running in the AST interpreter, but fails when running for bytecode.
This commit is contained in:
parent
eb1f61f3b1
commit
016b31fae2
1 changed files with 12 additions and 0 deletions
|
@ -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);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue