From 1256cf035437150163221a563147c74e41c377ab Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Wed, 11 Mar 2015 13:08:32 -0400 Subject: [PATCH] Breaking test for #76 This test shows that deep references do not work currently. --- test/pathfilter.js | 11 ++++++++++- .../deep_ref/node_modules/deep/deeper/ref.js | 0 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 test/pathfilter/deep_ref/node_modules/deep/deeper/ref.js diff --git a/test/pathfilter.js b/test/pathfilter.js index cecd479c..142f94d6 100644 --- a/test/pathfilter.js +++ b/test/pathfilter.js @@ -2,7 +2,7 @@ var test = require('tape'); var resolve = require('../'); test('#62: deep module references and the pathFilter', function(t){ - t.plan(6); + t.plan(9); var resolverDir = __dirname + '/pathfilter/deep_ref'; var pathFilter = function(pkg, x, remainder){ @@ -14,9 +14,18 @@ test('#62: deep module references and the pathFilter', function(t){ resolve('deep/ref', { basedir : resolverDir }, function (err, res, pkg) { if (err) t.fail(err); + t.equal(pkg.version, "1.2.3"); t.equal(res, resolverDir + '/node_modules/deep/ref.js'); }); + + resolve('deep/deeper/ref', { basedir: resolverDir }, + function(err, res, pkg) { + if(err) t.fail(err); + t.notEqual(pkg, undefined); + t.equal(pkg.version, "1.2.3"); + t.equal(res, resolverDir + '/node_modules/deep/deeper/ref.js'); + }); resolve('deep/ref', { basedir : resolverDir, pathFilter : pathFilter }, function (err, res, pkg) { diff --git a/test/pathfilter/deep_ref/node_modules/deep/deeper/ref.js b/test/pathfilter/deep_ref/node_modules/deep/deeper/ref.js new file mode 100644 index 00000000..e69de29b