From 74658ca5e4e9871d77039bf0e9f90cb77aaf67cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Antonio=20Gonz=C3=A1lez?= Date: Thu, 13 Oct 2022 17:10:14 +0100 Subject: [PATCH] Rename to isBerry --- lib/packagers/yarn.js | 8 ++++---- tests/packagers/yarn.test.js | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/packagers/yarn.js b/lib/packagers/yarn.js index f38f9ea28f..fbd83a823f 100644 --- a/lib/packagers/yarn.js +++ b/lib/packagers/yarn.js @@ -29,7 +29,7 @@ class Yarn { return false; } - static isModernVersion(version) { + static isBerryVersion(version) { const versionNumber = version.charAt(0); const mainVersion = parseInt(versionNumber); return mainVersion > 1; @@ -139,16 +139,16 @@ class Yarn { if (packagerOptions.noInstall) { return BbPromise.resolve(); } - const isModern = Yarn.isModernVersion(version); + const isBerry = Yarn.isBerryVersion(version); const command = /^win/.test(process.platform) ? 'yarn.cmd' : 'yarn'; const args = ['install']; // Convert supported packagerOptions - if (!packagerOptions.noNonInteractive && !isModern) { + if (!packagerOptions.noNonInteractive && !isBerry) { args.push('--non-interactive'); } if (!packagerOptions.noFrozenLockfile) { - if (isModern) { + if (isBerry) { args.push('--immutable'); } else { args.push('--frozen-lockfile'); diff --git a/tests/packagers/yarn.test.js b/tests/packagers/yarn.test.js index 7300de6d7f..2f483defb1 100644 --- a/tests/packagers/yarn.test.js +++ b/tests/packagers/yarn.test.js @@ -28,15 +28,15 @@ describe('yarn', () => { expect(yarnModule.mustCopyModules).toBe(false); }); - describe('isModernVersion', () => { + describe('isBerryVersion', () => { it('Yarn version 1.22.19', () => { const yarnVersion = '1.22.19'; - expect(yarnModule.isModernVersion(yarnVersion)).toBe(false); + expect(yarnModule.isBerryVersion(yarnVersion)).toBe(false); }); it('Yarn version 3.2.3', () => { const yarnVersion = '3.2.3'; - expect(yarnModule.isModernVersion(yarnVersion)).toBe(true); + expect(yarnModule.isBerryVersion(yarnVersion)).toBe(true); }); });