[Pkg-javascript-commits] [node-read-only-stream] 07/22: passing test

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 883b64766d0d966702b0705f0416c15000d95819
Author: James Halliday <mail at substack.net>
Date:   Mon Sep 8 11:25:41 2014 +0100

    passing test
---
 package.json |  5 +++--
 test/ro.js   | 22 ++++++++++++++++++++++
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/package.json b/package.json
index 3a63d55..b23f895 100644
--- a/package.json
+++ b/package.json
@@ -8,8 +8,9 @@
     "readable-wrap": "^1.0.0"
   },
   "devDependencies": {
-    "through2": "~0.6.1",
-    "tape": "^2.13.2"
+    "concat-stream": "^1.4.6",
+    "tape": "^2.13.2",
+    "through2": "~0.6.1"
   },
   "scripts": {
     "test": "tape test/*.js"
diff --git a/test/ro.js b/test/ro.js
new file mode 100644
index 0000000..b7f4a55
--- /dev/null
+++ b/test/ro.js
@@ -0,0 +1,22 @@
+var test = require('tape');
+var readonly = require('../');
+var through = require('through2');
+var concat = require('concat-stream');
+
+test('readonly', function (t) {
+    t.plan(2);
+    
+    var stream = through();
+    stream.write('woo');
+    
+    var ro = readonly(stream);
+    ro.pipe(concat(function (body) {
+        t.equal(body.toString('utf8'), 'woo');
+    }));
+    
+    t.throws(function () {
+        ro.write('beep');
+    });
+    
+    stream.end();
+});

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