HEX
Server: Apache
System: Linux webd004.cluster130.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
User: frenchy (106757)
PHP: 7.4.33
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/f/r/e/frenchy/www/french-american.org/current/node_modules/gulp-uglyfly/test/streams.js
'use strict';
var test = require('tape'),
		Vinyl = require('vinyl'),
		gulpUglyfly = require('../'),
		Readable = require('stream').Readable,
		Stream = require('stream'),
		PluginError = require('gulp-util/lib/PluginError');
	
var testContentsInput = 'function errorFunction(error) {';

var testFile1 = new Vinyl({
	cwd: "/home/terin/broken-promises/",
	base: "/home/terin/broken-promises/test",
	path: "/home/terin/broken-promises/test/test1.js",
	contents: stringStream()
});

test('should emit error for stream files', function(t) {
	t.plan(6);

	var stream = gulpUglyfly();

	stream
		.on('data', function() {
			t.fail('should emit error for streams');
		})
		.on('error', function(e) {
			t.pass('emitted error');
			t.ok(e instanceof PluginError, 'error is a PluginError');
			t.equal(e.plugin, 'gulp-uglyfly', 'error is from gulp-uglyfly');
			t.equal(e.fileName, testFile1.path, 'error reports the correct file');
			// t.ok(e.stack, 'error has a stack');
			t.skip('error should have a stack');
			t.false(e.showStack, 'error is configured to not print stack');
		});

	stream.write(testFile1);
	stream.end();
});

function stringStream() {
	var stream = new Readable();

	stream._read = function() {
		this.push('terin');
		this.push(null);
	};

	return stream;
}