main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
799 bytes
|
Line | |
---|
1 | var path = require('path');
|
---|
2 | var test = require('tape');
|
---|
3 | var resolve = require('../');
|
---|
4 |
|
---|
5 | test('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 |
|
---|
20 | test('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.