Dieses Repository beinhaltet HTML- und Javascript Code zur einer NotizenWebApp auf Basis von Web Storage. Zudem sind Mocha/Chai Tests im Browser enthalten. https://meinenotizen.netlify.app/
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.

index.js 1.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. var es = require('event-stream')
  2. var combine = require('..')
  3. var test = require('tape')
  4. test('do not duplicate errors', function (test) {
  5. var errors = 0;
  6. var pipe = combine(
  7. es.through(function(data) {
  8. return this.emit('data', data);
  9. }),
  10. es.through(function(data) {
  11. return this.emit('error', new Error(data));
  12. })
  13. )
  14. pipe.on('error', function(err) {
  15. errors++
  16. test.ok(errors, 'expected error count')
  17. process.nextTick(function () {
  18. return test.end();
  19. })
  20. })
  21. return pipe.write('meh');
  22. })
  23. test('3 pipe do not duplicate errors', function (test) {
  24. var errors = 0;
  25. var pipe = combine(
  26. es.through(function(data) {
  27. return this.emit('data', data);
  28. }),
  29. es.through(function(data) {
  30. return this.emit('error', new Error(data));
  31. }),
  32. es.through()
  33. )
  34. pipe.on('error', function(err) {
  35. errors++
  36. test.ok(errors, 'expected error count')
  37. process.nextTick(function () {
  38. return test.end();
  39. })
  40. })
  41. return pipe.write('meh');
  42. })