Changed to through2 and added test to check whether errors are emitted
revised test to pass in CI
Merge pull request #1 from rowoot/master

Fix issue with this.emit()