Sha256: 6dc6c2ebbfbc2c09388ef24ae6fdc3a99cadfff6a5cfb7cb90e6e47df6659616

Contents?: true

Size: 806 Bytes

Versions: 17

Compression:

Stored size: 806 Bytes

Contents

var test = require('tape');
var path = require('path');
var resolve = require('../');

test('faulty basedir must produce error in windows', { skip: process.platform !== 'win32' }, function (t) {
    t.plan(1);

    var resolverDir = 'C:\\a\\b\\c\\d';

    resolve('tape/lib/test.js', { basedir: resolverDir }, function (err, res, pkg) {
        t.equal(!!err, true);
    });
});

test('non-existent basedir should not throw when preserveSymlinks is false', function (t) {
    t.plan(2);

    var opts = {
        basedir: path.join(path.sep, 'unreal', 'path', 'that', 'does', 'not', 'exist'),
        preserveSymlinks: false
    };

    var module = './dotdot/abc';

    resolve(module, opts, function (err, res) {
        t.equal(err.code, 'INVALID_BASEDIR');
        t.equal(res, undefined);
    });
});

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
immosquare-cleaner-0.1.60 node_modules/resolve/test/faulty_basedir.js
immosquare-cleaner-0.1.59 node_modules/resolve/test/faulty_basedir.js
immosquare-cleaner-0.1.58 node_modules/resolve/test/faulty_basedir.js
immosquare-cleaner-0.1.57 node_modules/resolve/test/faulty_basedir.js
immosquare-cleaner-0.1.56 node_modules/resolve/test/faulty_basedir.js
immosquare-cleaner-0.1.55 node_modules/resolve/test/faulty_basedir.js
immosquare-cleaner-0.1.54 node_modules/resolve/test/faulty_basedir.js
immosquare-cleaner-0.1.53 node_modules/resolve/test/faulty_basedir.js
immosquare-cleaner-0.1.52 node_modules/resolve/test/faulty_basedir.js
immosquare-cleaner-0.1.51 node_modules/resolve/test/faulty_basedir.js
immosquare-cleaner-0.1.50 node_modules/resolve/test/faulty_basedir.js
immosquare-cleaner-0.1.49 node_modules/resolve/test/faulty_basedir.js
immosquare-cleaner-0.1.48 node_modules/resolve/test/faulty_basedir.js
immosquare-cleaner-0.1.47 node_modules/resolve/test/faulty_basedir.js
immosquare-cleaner-0.1.46 node_modules/resolve/test/faulty_basedir.js
immosquare-cleaner-0.1.45 node_modules/resolve/test/faulty_basedir.js
decidim-0.26.8 packages/eslint-config/node_modules/eslint-plugin-react/node_modules/resolve/test/faulty_basedir.js