Rewrite buffered channel test.
This commit is contained in:
parent
5470201c79
commit
8c26f23ead
1 changed files with 3 additions and 5 deletions
|
@ -36,14 +36,12 @@ describe(`Channel`, function() {
|
|||
});
|
||||
|
||||
it(`creates a buffered channel`, async function() {
|
||||
const channel = Channel(2);
|
||||
(async () => {
|
||||
assert.equal(await channel.shift(), 0);
|
||||
})();
|
||||
|
||||
const channel = Channel(3);
|
||||
await channel.push(0);
|
||||
await channel.push(1);
|
||||
await channel.push(2);
|
||||
await channel.close();
|
||||
assert.deepEqual(await channel.values(), [0, 1, 2]);
|
||||
});
|
||||
|
||||
describe(`from`, function() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue