HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/RImmers2/portal.photomenu.nl/wwwroot/node_modules/is-stream-ended/test.js
'use strict';

var assert = require('assert');
var through = require('through2');

var isStreamEnded = require('./index.js');

describe('is-stream-ended', function () {
  it('should return the correct ended state', function () {
    var stream = through();
    assert.strictEqual(isStreamEnded(stream), false);

    stream.end();
    assert.strictEqual(isStreamEnded(stream), true);
  });

  it('should work with a provided state', function () {
    var stream = through();
    assert.strictEqual(isStreamEnded(stream._writableState), false);

    stream.end();
    assert.strictEqual(isStreamEnded(stream._writableState), true);
  });
});