', function (t) {     t.plan(0);      var files = {};     files[path.resolve('/foo/bar/baz.js')] = 'beep';      function opts(basedir) {         return {             basedir: path.resolve(basedir),             isFile: function (file, cb) {                 cb(null, Object.prototype.hasOwnProperty.call(files, path.resolve(file)));             },             readFile: function (file, cb) {                 cb(null, files[path.resolve(file)]);             }         };     }      resolve('./baz', opts('/foo/bar'), function (err, res, pkg) {         if (err) return t.fail(err);         t.equal(res, path.resolve('/foo/bar/baz.js'));         t.equal(pkg, undefined);     });      resolve('./baz.js', opts('/foo/bar'), function (err, res, pkg) {         if (err) return t.fail(err);         t.equal(res, path.resolve('/foo/bar/baz.js'));         t.equal(pkg, undefined);     });      resolve('baz', opts('/foo/bar'), function (err, res) {         t.equal(err.message, "Cannot find module 'baz' from '" + path.resolve('/foo/bar') + "'");         t.equal(err.code, 'MODULE_NOT_FOUND');     });      resolve('../baz', opts('/foo/bar'), function (err, res) {         t.equal(err.message, "Cannot find module '../baz' from '" + path.resolve('/foo/bar') + "'");         t.equal(err.code, 'MODULE_NOT_FOUND');     }); });  test('mock from package', function (t) {     t.plan(0);      var files = {};     files[path.resolve('/foo/bar/baz.js')] = 'beep';      function opts(basedir) {         return {             basedir: path.resolve(basedir),             isFile: function (file, cb) {                 cb(null, Object.prototype.hasOwnProperty.call(files, 