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.

17 lines
482 B

  1. var test = require('tape')
  2. var JSONStream = require('../')
  3. var testData = '{"rows":[{"hello":"world"}, {"foo": "bar"}]}'
  4. test('basic parsing', function (t) {
  5. t.plan(2)
  6. var parsed = JSONStream.parse("rows.*")
  7. var parsedKeys = {}
  8. parsed.on('data', function(match) {
  9. parsedKeys[Object.keys(match)[0]] = true
  10. })
  11. parsed.on('end', function() {
  12. t.equal(!!parsedKeys['hello'], true)
  13. t.equal(!!parsedKeys['foo'], true)
  14. })
  15. parsed.write(testData)
  16. parsed.end()
  17. })