![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/vreg/node_modules/resolve/test/ |
var path = require('path'); var test = require('tape'); var resolve = require('../'); test('dotdot', function (t) { t.plan(4); var dir = path.join(__dirname, '/dotdot/abc'); resolve('..', { basedir: dir }, function (err, res, pkg) { t.ifError(err); t.equal(res, path.join(__dirname, 'dotdot/index.js')); }); resolve('.', { basedir: dir }, function (err, res, pkg) { t.ifError(err); t.equal(res, path.join(dir, 'index.js')); }); }); test('dotdot sync', function (t) { t.plan(2); var dir = path.join(__dirname, '/dotdot/abc'); var a = resolve.sync('..', { basedir: dir }); t.equal(a, path.join(__dirname, 'dotdot/index.js')); var b = resolve.sync('.', { basedir: dir }); t.equal(b, path.join(dir, 'index.js')); });