aboutsummaryrefslogtreecommitdiff
path: root/node_modules/supports-preserve-symlinks-flag/test/index.js
blob: 9938d671691790a75bacefc6100b39d6e4ab937a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
'use strict';

var test = require('tape');
var semver = require('semver');

var supportsPreserveSymlinks = require('../');
var browser = require('../browser');

test('supportsPreserveSymlinks', function (t) {
	t.equal(typeof supportsPreserveSymlinks, 'boolean', 'is a boolean');

	t.equal(browser, null, 'browser file is `null`');
	t.equal(
		supportsPreserveSymlinks,
		null,
		'in a browser, is null',
		{ skip: typeof window === 'undefined' }
	);

	var expected = semver.satisfies(process.version, '>= 6.2');
	t.equal(
		supportsPreserveSymlinks,
		expected,
		'is true in node v6.2+, false otherwise (actual: ' + supportsPreserveSymlinks + ', expected ' + expected + ')',
		{ skip: typeof window !== 'undefined' }
	);

	t.end();
});