diff --git a/lib/rules/yo-version.js b/lib/rules/yo-version.js index 884c654..bd844d2 100644 --- a/lib/rules/yo-version.js +++ b/lib/rules/yo-version.js @@ -18,7 +18,7 @@ exports.verify = async () => { const result = await binVersionCheck('yo', `>=${version}`); return result; } catch (error) { - if (error.name === 'InvalidBinVersion') { + if (error.name === 'InvalidBinaryVersion') { return errors.oldYoVersion(); } diff --git a/package.json b/package.json index 9e1623f..d72ad69 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ ], "dependencies": { "ansi-styles": "^3.2.0", - "bin-version-check": "^3.0.0", + "bin-version-check": "^4.0.0", "chalk": "^2.3.0", "global-agent": "^2.0.0", "global-tunnel-ng": "^2.5.3", diff --git a/test/rule-yo-version.js b/test/rule-yo-version.js index d823deb..9b70a6d 100644 --- a/test/rule-yo-version.js +++ b/test/rule-yo-version.js @@ -27,4 +27,11 @@ describe('yo version', () => { const error = await rule.verify(); assert(error, error); }); + + it('fail if it\'s invalid version range', async () => { + latestVersion = {...latestVersion, then: cb => cb('-1')}; + + const error = await rule.verify(); + assert(error, error); + }); });