Re: [whatwg/streams] Change 3 tests from async_test to promise_test (#537)

tyoshino commented on this pull request.

lgtm

>      writer.write('a');
 
     writer.close();
 
-    writer.ready.then(t.step_func(v => {
-      readyFulfilledAlready = true;
-      assert_equals(v, undefined, 'ready promise was fulfilled with undefined');
-      t.done();
-    }));
-  }), 0);
-}, 'If close is called on a WritableStream in waiting state, ready will be fulfilled immediately even if close ' +
+    return writer.ready.then(v => {
+      assert_false(asyncCloseFinished, 'ready promise should be called before async close completes');

called -> fulfilled

>      close() {
-      return new Promise(resolve => {
-        setTimeout(t.step_func(() => {
-          t.ok(readyFulfilledAlready, 'ready should have fulfilled already');
-          resolve();
-        }), 50);
-      });
+      return delay(50).then(() => asyncCloseFinished = true);

this test was not waiting for t.ok(readyFulfilledAlready). right? good catch!

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/pull/537#pullrequestreview-4215973

Received on Friday, 14 October 2016 07:05:10 UTC