From 0a4fe56813d5438e8988589af06f91fe15a3c674 Mon Sep 17 00:00:00 2001 From: Tommy Markley Date: Thu, 17 Mar 2022 16:29:17 +0000 Subject: [PATCH] Fixes inconsistent plugin installation tests * The tests assumed that the platform/architecture combo the tests were run from was always linux/x64. * Introduced in #1316. Signed-off-by: Tommy Markley --- src/cli_plugin/install/settings.test.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/cli_plugin/install/settings.test.js b/src/cli_plugin/install/settings.test.js index 0808ddf03cdc..63375dd18723 100644 --- a/src/cli_plugin/install/settings.test.js +++ b/src/cli_plugin/install/settings.test.js @@ -77,6 +77,14 @@ describe('parse function', function () { }); it('produces expected defaults', function () { + Object.defineProperties(process, { + platform: { + value: 'linux', + }, + arch: { + value: 'x64', + }, + }); expect(parse(command, { ...defaultOptions }, osdPackage)).toMatchInlineSnapshot(` Object { "config": "", @@ -97,6 +105,14 @@ describe('parse function', function () { }); it('consumes overrides', function () { + Object.defineProperties(process, { + platform: { + value: 'linux', + }, + arch: { + value: 'x64', + }, + }); const options = { quiet: true, silent: true, @@ -129,7 +145,7 @@ describe('parse function', function () { value: 'win32', }, arch: { - value: ORIGINAL_ARCHITECTURE, + value: 'x64', }, }); expect(() => parse(command, { ...defaultOptions }, osdPackage)).toThrow( @@ -140,7 +156,7 @@ describe('parse function', function () { it('should not throw when on a non-x64 arch', function () { Object.defineProperties(process, { platform: { - value: ORIGINAL_PLATFORM, + value: 'linux', }, arch: { value: 'arm64',