Add some.

This commit is contained in:
David Braun 2017-10-17 11:02:12 -04:00
parent 78d26ef021
commit ce97802a8e
3 changed files with 40 additions and 0 deletions

View file

@ -336,6 +336,14 @@ describe(`Channel object`, function() {
});
});
it(`some`, async function() {
const even = value => value % 2 === 0;
const channel = Channel.of(0, 1, 2);
assert(await channel.some(even));
assert.deepEqual(await toArray(channel), [1, 2]);
assert(!await Channel.of(1, 3, 5).some(even));
});
it(`value`, async function() {
const channel = Channel();
(async () => {