This repository has been archived by the owner on Oct 30, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #953 from drewfish/skip-dupe-pkg
skip packages that have already been visited
- Loading branch information
Showing
4 changed files
with
70 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
tests/fixtures/packages/node_modules/b/node_modules/a/package.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ YUI().use('test', function(Y) { | |
'breadth first basics': function() { | ||
var order = []; | ||
var walker = new libwalker.BreadthFirst(fixtures); | ||
var whichPkgA = 0; | ||
walker.walk(function(err, info) { | ||
order.push(info.pkg.name + '@' + info.pkg.version); | ||
switch(info.pkg.name) { | ||
|
@@ -32,13 +33,20 @@ YUI().use('test', function(Y) { | |
break; | ||
|
||
case 'a': | ||
A.areSame(1, info.depth); | ||
whichPkgA += 1; | ||
A.areSame('666.1.0', info.pkg.version); | ||
AA.itemsAreSame(['root'], info.parents); | ||
A.areSame(libpath.join(fixtures,'node_modules/a'), info.dir); | ||
if (1 === whichPkgA) { | ||
A.areSame(1, info.depth, 'a depth'); | ||
AA.itemsAreSame(['root'], info.parents); | ||
A.areSame(libpath.join(fixtures,'node_modules/a'), info.dir); | ||
} else { | ||
A.areSame(2, info.depth, 'a depth'); | ||
AA.itemsAreSame(['b', 'root'], info.parents); | ||
A.areSame(libpath.join(fixtures,'node_modules/b/node_modules/a'), info.dir); | ||
} | ||
break; | ||
case 'aa': | ||
A.areSame(2, info.depth); | ||
A.areSame(2, info.depth, 'a depth'); | ||
A.areSame('666.1.1', info.pkg.version); | ||
AA.itemsAreSame(['a','root'], info.parents); | ||
A.areSame(libpath.join(fixtures,'node_modules/a/node_modules/aa'), info.dir); | ||
|
@@ -102,6 +110,7 @@ YUI().use('test', function(Y) { | |
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
//'[email protected]', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters