Skip to content

Commit

Permalink
bugfix: excluding now matches only a word, not if starting with
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Jahn committed May 21, 2016
1 parent 5e8e2d2 commit 7af84a6
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib/run.js
Expand Up @@ -132,7 +132,7 @@ function run(config, done) {
excludedModules = config.exclude.split(",").map(function (name) {
return name.trim();
});
isExcluded = info.name.match(new RegExp("(" + excludedModules.join("|") + ")"), "g");
isExcluded = info.name.match(new RegExp("^(" + excludedModules.join("|") + ")$"));
}

// Check for hyphen in version string as this is a prerelease version according to SemVer
Expand Down
41 changes: 30 additions & 11 deletions test/run.js
Expand Up @@ -57,6 +57,13 @@ var outdatedModulesExclude = {
location: "unicons",
type: "dependencies"
},
"servus.jsShouldNotBeExclued": {
current: "1.1.4",
wanted: "1.1.5",
latest: "2.0.0",
location: "servus.jsShouldNotBeExclued",
type: "dependencies"
},
unicons: {
current: "0.1.4",
wanted: "1.1.5",
Expand All @@ -67,17 +74,29 @@ var outdatedModulesExclude = {
};

var expectedOptionsExclude = {
infos: [{
current: "0.1.4",
wanted: "1.1.5",
latest: "2.0.0",
location: "unicons",
type: "dependencies",
name: "unicons",
saveCmd: "--save",
updateTo: "2.0.0"
}],
total: 1
infos: [
{
current: "1.1.4",
wanted: "1.1.5",
latest: "2.0.0",
location: "servus.jsShouldNotBeExclued",
type: "dependencies",
name: "servus.jsShouldNotBeExclued",
saveCmd: "--save",
updateTo: "2.0.0"
},
{
current: "0.1.4",
wanted: "1.1.5",
latest: "2.0.0",
location: "unicons",
type: "dependencies",
name: "unicons",
saveCmd: "--save",
updateTo: "2.0.0"
}
],
total: 2
};

var outdatedModulesUnstable = {
Expand Down

0 comments on commit 7af84a6

Please sign in to comment.