[Pkg-javascript-commits] [node-jsonstream] 14/214: failing test for unimplemented stringifyObject

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 1 12:58:33 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 e787e940cec4f32c3ae3c8a09f23fbbad0fa4924
Author: James Halliday <mail at substack.net>
Date:   Wed Feb 22 07:52:57 2012 -0800

    failing test for unimplemented stringifyObject
---
 test/stringify_object.js | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/test/stringify_object.js b/test/stringify_object.js
new file mode 100644
index 0000000..cf19e8e
--- /dev/null
+++ b/test/stringify_object.js
@@ -0,0 +1,42 @@
+
+var fs = require ('fs')
+  , join = require('path').join
+  , file = join(__dirname, 'fixtures','all_npm.json')
+  , JSONStream = require('../')
+  , it = require('it-is').style('colour')
+
+  function randomObj () {
+    return (
+      Math.random () < 0.4
+      ? {hello: 'eonuhckmqjk',
+          whatever: 236515,
+          lies: true,
+          nothing: [null],
+          stuff: [Math.random(),Math.random(),Math.random()]
+        } 
+      : ['AOREC', 'reoubaor', {ouec: 62642}, [[[], {}, 53]]]
+    )
+  }
+
+var expected =  {}
+  , stringify = JSONStream.stringifyObject()
+  , es = require('event-stream')
+  , stringified = ''
+  , called = 0
+  , count = 10
+  , ended = false
+  
+while (count --)
+  var key = Math.random().toString(16).slice(2)
+  expected[key] = randomObj()
+  stringify.write(key, randomObj)
+
+  es.connect(
+    stringify,
+    //JSONStream.parse([/./]),
+    es.writeArray(function (err, lines) {
+      
+      it(JSON.parse(lines.join(''))).deepEqual(expected)
+      console.error('PASSED')
+    })
+  )

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