Skip to content

Commit

Permalink
fixup! feat: vowTools.allVowsSettled
Browse files Browse the repository at this point in the history
  • Loading branch information
0xpatrickdev committed Sep 13, 2024
1 parent c669a6c commit 5e572f9
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions packages/vow/test/watch-utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,3 +293,24 @@ test('allVowsSettled returns vows in order', async t => {
reason: new Error('c'),
});
});

test.failing('allVowsSettled handles unstorable', async t => {
const zone = makeHeapZone();
const { watch, when, allVowsSettled } = prepareBasicVowTools(zone);

const nonPassable = () => 'im a function';
t.is(zone.isStorable(nonPassable), false);

const vowA = watch(Promise.resolve('a'));
const vowB = watch(nonPassable);

// FIXME Promise returned by test never resolved
const result = await when(allVowsSettled([vowA, vowB]));

t.is(result.length, 2);
t.deepEqual(result[0], { status: 'fulfilled', value: 'a' });
t.deepEqual(result[2], {
status: 'rejected',
reason: 'Unstorable result was lost',
});
});

0 comments on commit 5e572f9

Please sign in to comment.