Channel.select: Complain if not passed an array.
This commit is contained in:
parent
32af6e8987
commit
3af150ae49
2 changed files with 35 additions and 26 deletions
|
@ -124,6 +124,12 @@ describe(`Channel`, function() {
|
|||
await Channel.select([Promise.resolve()]);
|
||||
}, new TypeError(`Channel.select accepts only promises returned by push & shift.`));
|
||||
});
|
||||
|
||||
it(`complains if not given an array`, function() {
|
||||
assertRejects(async () => {
|
||||
await Channel.select(Channel.of(0).shift(), Channel.of(1).shift());
|
||||
}, new TypeError(`Channel.select: Argument must be an array.`));
|
||||
});
|
||||
});
|
||||
|
||||
describe(`functional interface`, async function() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue