Re: [whatwg/streams] Port writable stream abort tests to wpt (#540)

marvinhagemeister commented on this pull request.



> +      () => { throw new Error('closing should not succeed'); },
+      r => assert_equals(r.constructor.toString(), TypeError.toString(), 'closing should reject with the given reason')
+    ),
+    writer.abort().then(
+      () => { throw new Error('aborting a second time should not succeed'); },
+      r => assert_equals(r.constructor.toString(), TypeError.toString(), 'aborting a second time should reject ' +
+        'with the given reason')
+    ),
+    writer.closed.then(
+      () => { throw new Error('closed fulfilled unexpectedly'); },
+      r => assert_equals(r.constructor.toString(), TypeError.toString(), 'closed should reject with a TypeError')
+    )
+  ]);
+}, 'Aborting a WritableStream puts it in an errored state, with stored error equal to the abort reason');
+
+test(() => {

I'm unsure where to import `assert_promise_rejects` from. This function seems to be duplicated inside the `web-platform-tests` repo. I tried including one of the existing functions, but get an URL error by testharness

-- 
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/540

Received on Wednesday, 19 October 2016 08:29:44 UTC