'use strict';

// MODULES //

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


// TESTS //

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

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

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

'use strict';

// MODULES //

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


// TESTS //

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

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

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

Fix failing test