source: imaps-frontend/node_modules/resolve/test/faulty_basedir.js

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
Line 
1var test = require('tape');
2var path = require('path');
3var resolve = require('../');
4
5test('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
15test('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.