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.

pipeline.asynct.js 1019B

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