Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
stream.pipe( through.obj( function( doc, enc, next ){
t.equal( Object.getPrototypeOf(doc), Document.prototype, 'correct proto' );
t.equal( doc.getId(), 'X/1', 'correct id' );
t.equal( doc.getLayer(), 'venue', 'defaults to venue' );
t.end(); // test will fail if not called (or called twice).
next();
}));
stream.write({ id: 1, type: 'X' });