Skip to content

Commit

Permalink
fix one more case of non strict deps, refactor tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jehy committed Jan 30, 2019
1 parent 7c2c51b commit a66406b
Show file tree
Hide file tree
Showing 5 changed files with 130 additions and 3,473 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -2,3 +2,4 @@
node_modules
config/config.json
.nyc_output
package-lock.json
9 changes: 8 additions & 1 deletion check_exact.js
Expand Up @@ -14,7 +14,14 @@ function checkExactVersion(key, value, res)
}
return res;
}
if (nonExactCharacters.some(char=>value.includes(char))) {
const hasMinorAndPatch = value.split('').reduce((count, item)=>{
if (item === '.')
{
return count + 1;
}
return count;
}, 0) > 1;
if (!hasMinorAndPatch || nonExactCharacters.some(char=>value.includes(char))) {
res.log.push(`Dependency ${key} should be exact, got "${value}"`);
res.result = false;
return res;
Expand Down

0 comments on commit a66406b

Please sign in to comment.