Skip to content

Commit

Permalink
Fixes inconsistent plugin installation tests (#1346)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
(cherry picked from commit 7aba935)
  • Loading branch information
Tommy Markley authored and github-actions[bot] committed Apr 28, 2022
1 parent 7422ad6 commit 074f615
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/cli_plugin/install/settings.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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": "",
Expand All @@ -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,
Expand Down Expand Up @@ -129,7 +145,7 @@ describe('parse function', function () {
value: 'win32',
},
arch: {
value: ORIGINAL_ARCHITECTURE,
value: 'x64',
},
});
expect(() => parse(command, { ...defaultOptions }, osdPackage)).toThrow(
Expand All @@ -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',
Expand Down

0 comments on commit 074f615

Please sign in to comment.