[Pkg-javascript-commits] [node-read-only-stream] 09/22: streams1 test, 100% coverage

Bastien Roucariès rouca at moszumanska.debian.org
Sun Aug 20 13:52:18 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-read-only-stream.

commit e73ca327dfb710ad9631a42b88185a8b29bd3729
Author: James Halliday <mail at substack.net>
Date:   Mon Sep 8 11:28:09 2014 +0100

    streams1 test, 100% coverage
---
 test/streams1.js | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/test/streams1.js b/test/streams1.js
new file mode 100644
index 0000000..dfe408f
--- /dev/null
+++ b/test/streams1.js
@@ -0,0 +1,21 @@
+var test = require('tape');
+var readonly = require('../');
+var through = require('through');
+var concat = require('concat-stream');
+
+test('streams1', function (t) {
+    t.plan(2);
+    
+    var stream = through();
+    
+    var ro = readonly(stream);
+    ro.pipe(concat(function (body) {
+        t.equal(body.toString('utf8'), 'woo');
+    }));
+    
+    t.throws(function () {
+        ro.write('beep');
+    });
+    
+    stream.end('woo');
+});

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-read-only-stream.git



More information about the Pkg-javascript-commits mailing list