'use strict';

// MODULES //

var tape = require( 'tape' );
var proxyquire = require( 'proxyquire' );
var isNode = require( './../lib/is_node.js' );


// TESTS //

tape( 'main export is a function', function test( t ) {
	t.ok( true, __filename );
	t.equal( typeof isNode, 'function', 'main export is a function' );
	t.end();
});

tape( 'the function returns `true` if runtime is Node.js', function test( t ) {
	var isNode = proxyquire('./../lib/is_node.js', {
		'@stdlib/utils/is-object': alwaysTrue,
		'@stdlib/utils/is-string': alwaysTrue
	});
	t.equal( isNode(), true, 'is Node.js' );
	t.end();
		
	/**
	* Returns true.
	* 
	* @example
	* alwaysTrue()
	* // returns true
	*/
	function alwaysTrue() {
		return true;
	} // end FUNCTION alwaysTrue()
});

tape( 'the function returns `false` if runtime is not Node.js', function test( t ) {
	var isNode = proxyquire('./../lib/is_node.js', {
		'@stdlib/utils/is-object': alwaysFalse,
		'@stdlib/utils/is-string': alwaysFalse
	});
	t.equal( isNode(), false, 'is not Node.js' );
	t.end();
	
	/**
	* Returns false.
	* 
	* @example
	* alwaysFalse()
	* // returns false
	*/
	function alwaysFalse() {
		return false;
	} // end FUNCTION alwaysFalse()
});

@@ -616,24 +616,36 @@
 s true.%0A%09* %0A
+%09* @private%0A
 %09* @example%0A
@@ -1065,24 +1065,36 @@
  false.%0A%09* %0A
+%09* @private%0A
 %09* @example%0A

Make functions private