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:
806 bytes
|
Rev | Line | |
---|
[d565449] | 1 | var test = require('tape');
|
---|
| 2 | var path = require('path');
|
---|
| 3 | var resolve = require('../');
|
---|
| 4 |
|
---|
| 5 | test('faulty basedir must produce error in windows', { skip: process.platform !== 'win32' }, function (t) {
|
---|
| 6 | t.plan(1);
|
---|
| 7 |
|
---|
| 8 | var resolverDir = 'C:\\a\\b\\c\\d';
|
---|
| 9 |
|
---|
| 10 | resolve('tape/lib/test.js', { basedir: resolverDir }, function (err, res, pkg) {
|
---|
| 11 | t.equal(!!err, true);
|
---|
| 12 | });
|
---|
| 13 | });
|
---|
| 14 |
|
---|
| 15 | test('non-existent basedir should not throw when preserveSymlinks is false', function (t) {
|
---|
| 16 | t.plan(2);
|
---|
| 17 |
|
---|
| 18 | var opts = {
|
---|
| 19 | basedir: path.join(path.sep, 'unreal', 'path', 'that', 'does', 'not', 'exist'),
|
---|
| 20 | preserveSymlinks: false
|
---|
| 21 | };
|
---|
| 22 |
|
---|
| 23 | var module = './dotdot/abc';
|
---|
| 24 |
|
---|
| 25 | resolve(module, opts, function (err, res) {
|
---|
| 26 | t.equal(err.code, 'INVALID_BASEDIR');
|
---|
| 27 | t.equal(res, undefined);
|
---|
| 28 | });
|
---|
| 29 | });
|
---|
Note:
See
TracBrowser
for help on using the repository browser.