<commit_before>
// MODULES //

var // Expectation library:
	chai = require( 'chai' ),

	// Transform stream class:
	Transform = require( 'readable-stream' ).Transform,

	// Mock writing to a stream:
	mockWrite = require( 'flow-mock-write' ),

	// Mock reading from a stream:
	mockRead = require( 'flow-mock-read' ),

	// Module to be tested:
	stream = require( './../lib' );


// VARIABLES //

var expect = chai.expect,
	assert = chai.assert;


// TESTS //

describe( 'flow-to-string', function tests() {
	'use strict';

	describe( 'class', function tests() {

		it( 'should export a function', function test() {
			expect( stream ).to.be.a( 'function' );
		});

		it( 'should throw an error if not provided a bad option', function test() {
			expect( foo ).to.throw( TypeError );

			function foo() {
				stream({'objectMode': []});
			}
		});

		it( 'should return a transform stream', function test() {
			var opts = {
					'encoding': 'utf8',
					'objectMode': true,
					'highWaterMark': 16,
					'allowHalfOpen': true
				};
			assert.instanceOf( stream( opts ), Transform );
		});

		it( 'should convert each stream datum to a string when in object mode', function test( done ) {
			var data = [
					1,
					'2',
					false,
					NaN,
					undefined,
					function(){},<commit_msg>[FIX] test case.<commit_after>
// MODULES //

var // Expectation library:
	chai = require( 'chai' ),

	// Transform stream class:
	Transform = require( 'readable-stream' ).Transform,

	// Mock writing to a stream:
	mockWrite = require( 'flow-mock-write' ),

	// Mock reading from a stream:
	mockRead = require( 'flow-mock-read' ),

	// Module to be tested:
	stream = require( './../lib' );


// VARIABLES //

var expect = chai.expect,
	assert = chai.assert;


// TESTS //

describe( 'flow-to-string', function tests() {
	'use strict';

	describe( 'class', function tests() {

		it( 'should export a function', function test() {
			expect( stream ).to.be.a( 'function' );
		});

		it( 'should throw an error if provided a bad option', function test() {
			expect( foo ).to.throw( TypeError );

			function foo() {
				stream({'objectMode': []});
			}
		});

		it( 'should return a transform stream', function test() {
			var opts = {
					'encoding': 'utf8',
					'objectMode': true,
					'highWaterMark': 16,
					'allowHalfOpen': true
				};
			assert.instanceOf( stream( opts ), Transform );
		});

		it( 'should convert each stream datum to a string when in object mode', function test( done ) {
			var data = [
					1,
					'2',
					false,
					NaN,
					undefined,
					function(){},
{'fraction_non_alphanumeric': 0.1609150833656456, 'fraction_numerical': 0.0038774718883288098, 'mean_word_length': 2.7774524158125917, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3654385', 'n_tokens_mistral': 988, 'n_tokens_neox': 814, 'n_words': 264}