Sha256: 1ad684c31a7e505920a0f26205bb01f346c8284e0ad16146cea8dfd03458d7fa

Contents?: true

Size: 452 Bytes

Versions: 6

Compression:

Stored size: 452 Bytes

Contents

var test = require('tape')
var through = require('../')

// must emit end before close.

test('end before close', function (assert) {
  var ts = through()
  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.ok(closed)
  assert.end()
})

Version data entries

6 entries across 4 versions & 2 rubygems

Version Path
sprockets-browserify-0.3.0 node_modules/browserify/node_modules/browser-pack/node_modules/JSONStream/node_modules/through/test/end.js
sprockets-browserify-0.3.0 node_modules/browserify/node_modules/deps-sort/node_modules/JSONStream/node_modules/through/test/end.js
sprockets-browserify-0.3.0 node_modules/browserify/node_modules/JSONStream/node_modules/through/test/end.js
sprockets-browserify-0.2.0 node_modules/browserify/node_modules/through/test/end.js
ruby-wisp-source-0.8.0 vendor/node_modules/browserify/node_modules/through/test/end.js
ruby-wisp-source-0.7.0 vendor/node_modules/browserify/node_modules/through/test/end.js