updated npm modules
This commit is contained in:
26
node_modules/resolve/test/mock.js
generated
vendored
26
node_modules/resolve/test/mock.js
generated
vendored
@@ -8,12 +8,18 @@ test('mock', function (t) {
|
||||
var files = {};
|
||||
files[path.resolve('/foo/bar/baz.js')] = 'beep';
|
||||
|
||||
var dirs = {};
|
||||
dirs[path.resolve('/foo/bar')] = true;
|
||||
|
||||
function opts(basedir) {
|
||||
return {
|
||||
basedir: path.resolve(basedir),
|
||||
isFile: function (file, cb) {
|
||||
cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file)));
|
||||
},
|
||||
isDirectory: function (dir, cb) {
|
||||
cb(null, !!dirs[path.resolve(dir)]);
|
||||
},
|
||||
readFile: function (file, cb) {
|
||||
cb(null, files[path.resolve(file)]);
|
||||
}
|
||||
@@ -49,12 +55,18 @@ test('mock from package', function (t) {
|
||||
var files = {};
|
||||
files[path.resolve('/foo/bar/baz.js')] = 'beep';
|
||||
|
||||
var dirs = {};
|
||||
dirs[path.resolve('/foo/bar')] = true;
|
||||
|
||||
function opts(basedir) {
|
||||
return {
|
||||
basedir: path.resolve(basedir),
|
||||
isFile: function (file, cb) {
|
||||
cb(null, Object.prototype.hasOwnProperty.call(files, file));
|
||||
},
|
||||
isDirectory: function (dir, cb) {
|
||||
cb(null, !!dirs[path.resolve(dir)]);
|
||||
},
|
||||
'package': { main: 'bar' },
|
||||
readFile: function (file, cb) {
|
||||
cb(null, files[file]);
|
||||
@@ -94,12 +106,19 @@ test('mock package', function (t) {
|
||||
main: './baz.js'
|
||||
});
|
||||
|
||||
var dirs = {};
|
||||
dirs[path.resolve('/foo')] = true;
|
||||
dirs[path.resolve('/foo/node_modules')] = true;
|
||||
|
||||
function opts(basedir) {
|
||||
return {
|
||||
basedir: path.resolve(basedir),
|
||||
isFile: function (file, cb) {
|
||||
cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file)));
|
||||
},
|
||||
isDirectory: function (dir, cb) {
|
||||
cb(null, !!dirs[path.resolve(dir)]);
|
||||
},
|
||||
readFile: function (file, cb) {
|
||||
cb(null, files[path.resolve(file)]);
|
||||
}
|
||||
@@ -122,12 +141,19 @@ test('mock package from package', function (t) {
|
||||
main: './baz.js'
|
||||
});
|
||||
|
||||
var dirs = {};
|
||||
dirs[path.resolve('/foo')] = true;
|
||||
dirs[path.resolve('/foo/node_modules')] = true;
|
||||
|
||||
function opts(basedir) {
|
||||
return {
|
||||
basedir: path.resolve(basedir),
|
||||
isFile: function (file, cb) {
|
||||
cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file)));
|
||||
},
|
||||
isDirectory: function (dir, cb) {
|
||||
cb(null, !!dirs[path.resolve(dir)]);
|
||||
},
|
||||
'package': { main: 'bar' },
|
||||
readFile: function (file, cb) {
|
||||
cb(null, files[path.resolve(file)]);
|
||||
|
||||
Reference in New Issue
Block a user