[Pkg-javascript-commits] [node-jsonstream] 110/214: test mapper function

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 1 12:58:47 UTC 2017


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

rouca pushed a commit to branch master
in repository node-jsonstream.

commit 08ba2dd95da38d36da1918b60672c7b1312282fb
Author: Dominic Tarr <dominic.tarr at gmail.com>
Date:   Tue May 13 15:44:24 2014 +0200

    test mapper function
---
 test/map.js | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/test/map.js b/test/map.js
new file mode 100644
index 0000000..aab3218
--- /dev/null
+++ b/test/map.js
@@ -0,0 +1,21 @@
+
+var test = require('tape')
+
+var JSONStream = require('../')
+
+test('map function', function (t) {
+
+  var actual = []
+
+  stream = JSONStream.parse([true], function (e) { return e*10 })
+    stream.on('data', function (v) { actual.push(v)})
+    stream.on('end', function () {
+      t.deepEqual(actual, [10,20,30,40,50,60])
+      t.end()
+
+    })
+
+  stream.write(JSON.stringify([1,2,3,4,5,6], null, 2))
+  stream.end()
+
+})

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



More information about the Pkg-javascript-commits mailing list