Simple email application for Android. Original source code: https://framagit.org/dystopia-project/simple-email
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
921 B

  1. var fs = require ('fs')
  2. , join = require('path').join
  3. , file = join(__dirname, 'fixtures','all_npm.json')
  4. , JSONStream = require('../')
  5. , it = require('it-is').style('colour')
  6. function randomObj () {
  7. return (
  8. Math.random () < 0.4
  9. ? {hello: 'eonuhckmqjk',
  10. whatever: 236515,
  11. lies: true,
  12. nothing: [null],
  13. // stuff: [Math.random(),Math.random(),Math.random()]
  14. }
  15. : ['AOREC', 'reoubaor', {ouec: 62642}, [[[], {}, 53]]]
  16. )
  17. }
  18. var expected = []
  19. , stringify = JSONStream.stringify()
  20. , es = require('event-stream')
  21. , stringified = ''
  22. , called = 0
  23. , count = 10
  24. , ended = false
  25. while (count --)
  26. expected.push(randomObj())
  27. es.connect(
  28. es.readArray(expected),
  29. stringify,
  30. JSONStream.parse([true]),
  31. es.writeArray(function (err, lines) {
  32. it(lines).has(expected)
  33. console.error('PASSED')
  34. })
  35. )