From 9892574dc69d9aac8edfd080961cf46178c9e4a0 Mon Sep 17 00:00:00 2001 From: Logicer <81077770+Logicer16@users.noreply.github.com> Date: Thu, 3 Jun 2021 09:16:47 +1000 Subject: [PATCH] Update bin-version-check package (#53) --- lib/rules/yo-version.js | 2 +- package.json | 2 +- test/rule-yo-version.js | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) 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 377284f..c35e7e1 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); + }); });