-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Now that we support async functions, is the fact that this is in a closure going to be a problem?
I am near certain the answer is yes!
Look at this code:
test('a', t => {
t.is(await promiseA1(), await promiseA2());
});
test('b', t => {
t.is(await promiseB1(), await promiseB2());
});Now, assume both following sequence of events:
- test
astarts - test
ahalts as itawaits the resolution ofpromiseA1() - test
bstarts - test
bhalts as itawaits the resolution ofpromiseB1() promiseA1()resolves, and testaresumes.- test
ahalts as itawaits the resolution ofpromiseA2() promiseB1()resolves, and testbresumes.- test
bhalts as itawaits the resolution ofpromiseB2() promiseB2()resolves, and testbresumes.- test
bends promiseA2()resolves, and testaresumes.
It seems like events is going to be corrupted by step 12.
I think AVA is going to need to create a new enhanced assert object for each run.
@twada - thoughts?
Metadata
Metadata
Assignees
Labels
No labels