From 8c26f23eadbfd523bda4c41da11758eb01468c02 Mon Sep 17 00:00:00 2001 From: David Braun Date: Sat, 21 Oct 2017 15:31:24 -0400 Subject: [PATCH] Rewrite buffered channel test. --- test/index.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/test/index.js b/test/index.js index d7dcec4..79bd2b1 100644 --- a/test/index.js +++ b/test/index.js @@ -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() {