var test = require('tape') var through = require('../') // must emit end before close. test('end before close', function (assert) { var ts = through() ts.autoDestroy = false var ended = false, closed = false ts.on('end', function () { assert.ok(!closed) ended = true }) ts.on('close', function () { assert.ok(ended) closed = true }) ts.write(1) ts.write(2) ts.write(3) ts.end() assert.ok(ended) assert.notOk(closed) ts.destroy() assert.ok(closed) assert.end() })
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
async.js | File | 629 B | 0644 |
|
auto-destroy.js | File | 516 B | 0644 |
|
buffering.js | File | 1.47 KB | 0644 |
|
end.js | File | 707 B | 0644 |
|
index.js | File | 2.31 KB | 0644 |
|