source: trip-planner-front/node_modules/resolve/test/dotdot.js

Last change on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 799 bytes
RevLine 
[6a3a178]1var path = require('path');
2var test = require('tape');
3var resolve = require('../');
4
5test('dotdot', function (t) {
6 t.plan(4);
7 var dir = path.join(__dirname, '/dotdot/abc');
8
9 resolve('..', { basedir: dir }, function (err, res, pkg) {
10 t.ifError(err);
11 t.equal(res, path.join(__dirname, 'dotdot/index.js'));
12 });
13
14 resolve('.', { basedir: dir }, function (err, res, pkg) {
15 t.ifError(err);
16 t.equal(res, path.join(dir, 'index.js'));
17 });
18});
19
20test('dotdot sync', function (t) {
21 t.plan(2);
22 var dir = path.join(__dirname, '/dotdot/abc');
23
24 var a = resolve.sync('..', { basedir: dir });
25 t.equal(a, path.join(__dirname, 'dotdot/index.js'));
26
27 var b = resolve.sync('.', { basedir: dir });
28 t.equal(b, path.join(dir, 'index.js'));
29});
Note: See TracBrowser for help on using the repository browser.