Re: [streams] Convert readable stream pull() to promise-returning (#272)

> +    }
> +  });
> +
> +  t.equal(rs.state, 'waiting', 'stream starts out waiting');
> +
> +  rs.ready.then(() => {
> +    t.equal(rs.state, 'readable', 'stream becomes readable (even before promise fulfills)');
> +    t.equal(timesCalled, 1, 'pull is not yet called a second time');
> +    t.equal(rs.read(), 1, 'read() returns enqueued value');
> +
> +    setTimeout(() => {
> +      t.equal(timesCalled, 1, 'after 30 ms, pull has still only been called once');
> +
> +      resolve();
> +
> +      returnedPromise.then(() => {

I think it is accurate. After the `returnedPromise` fulfills, the stream calls `pull()` again. So we should also subscribe to `returnedPromise` to test if `pull()` was called.

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/pull/272/files#r24183599

Received on Thursday, 5 February 2015 18:02:26 UTC