1'use strict'; 2 3require('../common'); 4 5const assert = require('assert'); 6const Transform = require('stream').Transform; 7 8 9const expected = 'asdf'; 10 11 12function _transform(d, e, n) { 13 n(); 14} 15 16function _flush(n) { 17 n(null, expected); 18} 19 20const t = new Transform({ 21 transform: _transform, 22 flush: _flush 23}); 24 25t.end(Buffer.from('blerg')); 26t.on('data', (data) => { 27 assert.strictEqual(data.toString(), expected); 28}); 29