From f80640a45bfb9b46849c45d5af22abefbb3a1d70 Mon Sep 17 00:00:00 2001 From: Mike Donnalley Date: Thu, 6 Jun 2024 14:56:31 -0600 Subject: [PATCH] test: use oclif/test v4 (#630) --- package.json | 2 +- test/commands/alias/list.test.ts | 55 ++++--- test/commands/alias/set.test.ts | 27 ++-- test/commands/alias/unset.test.ts | 43 +++--- test/commands/config/get.test.ts | 223 ++++++++++++++--------------- test/commands/config/list.test.ts | 115 +++++++-------- test/commands/config/set.test.ts | 163 +++++++++++---------- test/commands/config/unset.test.ts | 111 +++++++------- yarn.lock | 129 +++-------------- 9 files changed, 372 insertions(+), 496 deletions(-) diff --git a/package.json b/package.json index c4cb6372..bb52421f 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ }, "devDependencies": { "@oclif/plugin-command-snapshot": "^5.2.0", - "@oclif/test": "^3.2.15", + "@oclif/test": "^4", "@salesforce/cli-plugins-testkit": "^5.3.6", "@salesforce/dev-scripts": "^10.1.0", "@salesforce/plugin-command-reference": "^3.0.85", diff --git a/test/commands/alias/list.test.ts b/test/commands/alias/list.test.ts index e03bd057..681304e8 100644 --- a/test/commands/alias/list.test.ts +++ b/test/commands/alias/list.test.ts @@ -4,45 +4,38 @@ * Licensed under the BSD 3-Clause license. * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { expect, test } from '@oclif/test'; +import { expect } from 'chai'; +import { runCommand } from '@oclif/test'; import { TestContext } from '@salesforce/core/testSetup'; describe('alias list', () => { const $$ = new TestContext(); describe('no existing aliases', () => { - test - .stdout() - .command(['alias list']) - .it('shows no results', (ctx) => { - expect(ctx.stdout).to.contain('No results'); - }); + it('shows no results', async () => { + $$.stubAliases({}); + const { stdout, result } = await runCommand('alias list'); + expect(stdout).to.contain('No results'); + expect(result).to.be.empty; + }); - test - .stdout() - .command(['alias list', '--json']) - .it('shows no results with --json', (ctx) => { - const response = JSON.parse(ctx.stdout); - expect(response.status).to.equal(0); - expect(response.result.length).to.equal(0); - }); - }); + it('shows no results with --json', async () => { + $$.stubAliases({}); + const { stdout, result } = await runCommand('alias list --json'); + const response = JSON.parse(stdout); + expect(response.status).to.equal(0); + expect(response.result.length).to.equal(0); + expect(result).to.be.empty; + }); - describe('existing aliases', () => { - beforeEach(async () => { + it('shows existing aliases', async () => { $$.stubAliases({ Coffee: 'espresso' }); + const { result } = await runCommand('alias list'); + expect(result).to.deep.equal([ + { + alias: 'Coffee', + value: 'espresso', + }, + ]); }); - - test - .stdout() - .command(['alias list', '--json']) - .it('shows results', (ctx) => { - const response = JSON.parse(ctx.stdout); - expect(response.result).to.deep.equal([ - { - alias: 'Coffee', - value: 'espresso', - }, - ]); - }); }); }); diff --git a/test/commands/alias/set.test.ts b/test/commands/alias/set.test.ts index b3341e7c..ac3e1dd9 100644 --- a/test/commands/alias/set.test.ts +++ b/test/commands/alias/set.test.ts @@ -5,20 +5,19 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { expect, test } from '@oclif/test'; +import { expect } from 'chai'; +import { runCommand } from '@oclif/test'; describe('alias set', () => { - test - .stdout() - .command(['alias set', 'Coffee=espresso', '--json']) - .it('returns new alias', (ctx) => { - const response = JSON.parse(ctx.stdout); - expect(response.result).to.deep.equal([ - { - alias: 'Coffee', - success: true, - value: 'espresso', - }, - ]); - }); + it('returns new alias', async () => { + const { stdout } = await runCommand('alias set Coffee=espresso --json'); + const response = JSON.parse(stdout); + expect(response.result).to.deep.equal([ + { + alias: 'Coffee', + success: true, + value: 'espresso', + }, + ]); + }); }); diff --git a/test/commands/alias/unset.test.ts b/test/commands/alias/unset.test.ts index cbec185a..8dd71654 100644 --- a/test/commands/alias/unset.test.ts +++ b/test/commands/alias/unset.test.ts @@ -5,7 +5,8 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { expect, test } from '@oclif/test'; +import { expect } from 'chai'; +import { runCommand } from '@oclif/test'; import { TestContext } from '@salesforce/core/testSetup'; describe('alias unset', () => { @@ -18,28 +19,22 @@ describe('alias unset', () => { $$.SANDBOX.restore(); }); - test - .stdout() - .command(['alias unset', 'Coffee', '--json']) - .it('removes alias', (ctx) => { - const response = JSON.parse(ctx.stdout); - expect(response.result).to.deep.equal([ - { - alias: 'Coffee', - success: true, - value: 'espresso', - }, - ]); - }); + it('removes alias', async () => { + const { result } = await runCommand('alias unset Coffee --json'); + expect(result).to.deep.equal([ + { + alias: 'Coffee', + success: true, + value: 'espresso', + }, + ]); + }); - test - .stdout() - .command(['alias unset', 'Coffee', 'Bacon', '--json']) - .it('removes multiple aliases', (ctx) => { - const response = JSON.parse(ctx.stdout); - expect(response.result).to.deep.equal([ - { alias: 'Coffee', success: true, value: 'espresso' }, - { alias: 'Bacon', success: true, value: 'breakfast' }, - ]); - }); + it('removes multiple aliases', async () => { + const { result } = await runCommand('alias unset Coffee Bacon --json'); + expect(result).to.deep.equal([ + { alias: 'Coffee', success: true, value: 'espresso' }, + { alias: 'Bacon', success: true, value: 'breakfast' }, + ]); + }); }); diff --git a/test/commands/config/get.test.ts b/test/commands/config/get.test.ts index 4bca217f..c0233634 100644 --- a/test/commands/config/get.test.ts +++ b/test/commands/config/get.test.ts @@ -8,28 +8,22 @@ import path from 'node:path'; import { fileURLToPath } from 'node:url'; import { readFileSync } from 'node:fs'; -import { test, expect } from '@oclif/test'; +import { expect } from 'chai'; +import { runCommand } from '@oclif/test'; import { ConfigAggregator, OrgConfigProperties, SfConfigProperties } from '@salesforce/core'; import { stubMethod } from '@salesforce/ts-sinon'; -import { Plugin } from '@oclif/core'; +import { Config, Plugin } from '@oclif/core'; import sinon from 'sinon'; -import { calculateSuggestion } from '../../../src/config.js'; - -process.env.NODE_ENV = 'development'; +import { ConfigResponses, calculateSuggestion } from '../../../src/config.js'; describe('config:get', () => { - let sandbox: sinon.SinonSandbox; - beforeEach(() => { - sandbox = sinon.createSandbox(); - }); - afterEach(() => { - sandbox.restore(); + sinon.restore(); }); async function prepareStubs(global = true) { const location = global ? 'Global' : 'Local'; - stubMethod(sandbox, ConfigAggregator.prototype, 'getInfo') + stubMethod(sinon, ConfigAggregator.prototype, 'getInfo') .withArgs(OrgConfigProperties.TARGET_DEV_HUB) .returns({ key: OrgConfigProperties.TARGET_DEV_HUB, value: 'MyDevhub', location }) .withArgs(OrgConfigProperties.TARGET_ORG) @@ -40,115 +34,118 @@ describe('config:get', () => { .throws('FAILED'); } - test - .do(async () => prepareStubs(true)) - .stdout() - .command(['config:get', OrgConfigProperties.TARGET_DEV_HUB, OrgConfigProperties.TARGET_ORG, '--json']) - .it('should return values for globally configured properties', (ctx) => { - const { result } = JSON.parse(ctx.stdout); - expect(result).to.deep.equal([ - { - name: OrgConfigProperties.TARGET_DEV_HUB, - key: OrgConfigProperties.TARGET_DEV_HUB, - value: 'MyDevhub', - location: 'Global', - success: true, - }, - { - name: OrgConfigProperties.TARGET_ORG, - key: OrgConfigProperties.TARGET_ORG, - value: 'MyUser', - location: 'Global', - success: true, - }, - ]); + it('should return values for globally configured properties', async () => { + await prepareStubs(true); + const { result } = await runCommand([ + 'config:get', + OrgConfigProperties.TARGET_DEV_HUB, + OrgConfigProperties.TARGET_ORG, + '--json', + ]); + expect(result).to.deep.equal([ + { + name: OrgConfigProperties.TARGET_DEV_HUB, + key: OrgConfigProperties.TARGET_DEV_HUB, + value: 'MyDevhub', + location: 'Global', + path: undefined, + success: true, + }, + { + name: OrgConfigProperties.TARGET_ORG, + key: OrgConfigProperties.TARGET_ORG, + value: 'MyUser', + location: 'Global', + path: undefined, + success: true, + }, + ]); + }); + + it('should return values for locally configured properties', async () => { + await prepareStubs(false); + const { result } = await runCommand([ + 'config:get', + OrgConfigProperties.TARGET_DEV_HUB, + OrgConfigProperties.TARGET_ORG, + '--json', + ]); + expect(result).to.deep.equal([ + { + name: OrgConfigProperties.TARGET_DEV_HUB, + key: OrgConfigProperties.TARGET_DEV_HUB, + value: 'MyDevhub', + location: 'Local', + path: undefined, + success: true, + }, + { + name: OrgConfigProperties.TARGET_ORG, + key: OrgConfigProperties.TARGET_ORG, + value: 'MyUser', + location: 'Local', + path: undefined, + success: true, + }, + ]); + }); + + it('should gracefully handle un-configured properties', async () => { + await prepareStubs(); + const { result } = await runCommand(['config:get', OrgConfigProperties.ORG_API_VERSION, '--json']); + expect(result).to.deep.equal([ + { + key: OrgConfigProperties.ORG_API_VERSION, + name: OrgConfigProperties.ORG_API_VERSION, + success: true, + value: undefined, + path: undefined, + location: undefined, + }, + ]); + }); + + it('should gracefully handle failed attempts to ConfigAggregator.getInfo', async () => { + await prepareStubs(); + const { result } = await runCommand([ + 'config:get', + SfConfigProperties.DISABLE_TELEMETRY, + '--json', + ]); + expect(result?.[0].error?.name).to.equal('FAILED'); + }); + + describe('load custom config meta', () => { + it('fails when there is no matching loaded custom key', async () => { + const { result } = await runCommand(['config:get', 'customKey', '--json']); + expect(result?.[0].message).to.equal('Unknown config name: customKey.'); }); - test - .do(async () => prepareStubs(false)) - .stdout() - .command(['config:get', OrgConfigProperties.TARGET_DEV_HUB, OrgConfigProperties.TARGET_ORG, '--json']) - .it('should return values for locally configured properties', (ctx) => { - const { result } = JSON.parse(ctx.stdout); + it('should allow custom config meta for allowedProperties', async () => { + const root = path.dirname(fileURLToPath(import.meta.url)); + const mockPluginRoot = path.resolve(root, '../../config-meta-mocks/javascript-lib'); + const config = await Config.load(root); + config.plugins.set('sfdx-cli-js-plugin-2', { + root: mockPluginRoot, + hooks: {}, + pjson: JSON.parse(readFileSync(path.resolve(mockPluginRoot, 'package.json'), 'utf-8')), + name: 'sfdx-cli-js-plugin-2', + commands: [], + topics: [], + } as unknown as Plugin); + + const { result } = await runCommand(['config:get', 'customKey', '--json'], config); expect(result).to.deep.equal([ { - name: OrgConfigProperties.TARGET_DEV_HUB, - key: OrgConfigProperties.TARGET_DEV_HUB, - value: 'MyDevhub', - location: 'Local', - success: true, - }, - { - name: OrgConfigProperties.TARGET_ORG, - key: OrgConfigProperties.TARGET_ORG, - value: 'MyUser', - location: 'Local', + key: 'customKey', + location: undefined, + name: 'customKey', + path: undefined, success: true, + value: undefined, }, ]); }); - - test - .do(async () => prepareStubs()) - .stdout() - .command(['config:get', OrgConfigProperties.ORG_API_VERSION, '--json']) - .it('should gracefully handle unconfigured properties', (ctx) => { - const { result } = JSON.parse(ctx.stdout); - expect(result).to.deep.equal([ - { key: OrgConfigProperties.ORG_API_VERSION, name: OrgConfigProperties.ORG_API_VERSION, success: true }, - ]); - }); - - test - .do(async () => prepareStubs()) - .stdout() - .command(['config:get', SfConfigProperties.DISABLE_TELEMETRY, '--json']) - .it('should gracefully handle failed attempts to ConfigAggregator.getInfo', (ctx) => { - const response = JSON.parse(ctx.stdout); - expect(response.result[0].error.name).to.equal('FAILED'); - }); - - describe('load custom config meta', () => { - test - .stdout() - .command(['config:get', 'customKey', '--json']) - .it('fails when there is no matching loaded custom key', (ctx) => { - const response = JSON.parse(ctx.stdout); - expect(response.result[0].message).to.equal('Unknown config name: customKey.'); - }); - - test - .loadConfig() - .do((ctx) => { - const mockPluginRoot = path.resolve( - path.dirname(fileURLToPath(import.meta.url)), - '../../config-meta-mocks/javascript-lib' - ); - - // @ts-expect-error because oclif/test v3 uses oclif/core v3 but plugin-settings is using oclif/core v4 - // We can resolve the type error once we migrate these tests to oclif/test v4 - ctx.config.plugins.set('sfdx-cli-js-plugin-2', { - root: mockPluginRoot, - hooks: {}, - pjson: JSON.parse(readFileSync(path.resolve(mockPluginRoot, 'package.json'), 'utf-8')), - name: 'sfdx-cli-js-plugin-2', - commands: [], - topics: [], - } as unknown as Plugin); - }) - .stdout() - .stderr() - .command(['config:get', 'customKey', '--json']) - .it('should allow custom config meta for allowedProperties', (ctx) => { - const response = JSON.parse(ctx.stdout); - expect(response.result).to.deep.equal([ - { - key: 'customKey', - name: 'customKey', - success: true, - }, - ]); - }); }); describe('calculate suggestion', () => { diff --git a/test/commands/config/list.test.ts b/test/commands/config/list.test.ts index 0b87f490..9e874a4b 100644 --- a/test/commands/config/list.test.ts +++ b/test/commands/config/list.test.ts @@ -5,76 +5,67 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { test, expect } from '@oclif/test'; +import { expect } from 'chai'; +import { runCommand } from '@oclif/test'; import { ConfigAggregator, OrgConfigProperties } from '@salesforce/core'; import { stubMethod } from '@salesforce/ts-sinon'; -import { SinonSandbox } from 'sinon'; import sinon from 'sinon'; import { SfConfigProperties } from '@salesforce/core/config'; +import { ConfigResponses } from '../../../src/config.js'; describe('config:list', () => { - let sandbox: SinonSandbox; - beforeEach(() => { - sandbox = sinon.createSandbox(); - }); - afterEach(() => { - sandbox.restore(); + sinon.restore(); }); - test - .do(() => { - stubMethod(sandbox, ConfigAggregator.prototype, 'getConfigInfo').returns([ - { key: OrgConfigProperties.TARGET_DEV_HUB, value: 'MyDevhub', location: 'Global' }, - { key: SfConfigProperties.DISABLE_TELEMETRY, value: true, location: 'Global' }, - { key: OrgConfigProperties.TARGET_ORG, value: 'MyUser', location: 'Local' }, - { key: OrgConfigProperties.ORG_API_VERSION, value: '49.0', location: 'Local' }, - ]); - }) - .stdout() - .command(['config:list', '--json']) - .it('should return values for all configured properties', (ctx) => { - const { result } = JSON.parse(ctx.stdout); - expect(result).to.deep.equal([ - { - name: OrgConfigProperties.TARGET_DEV_HUB, - key: OrgConfigProperties.TARGET_DEV_HUB, - value: 'MyDevhub', - location: 'Global', - success: true, - }, - { - name: SfConfigProperties.DISABLE_TELEMETRY, - key: SfConfigProperties.DISABLE_TELEMETRY, - value: true, - location: 'Global', - success: true, - }, - { - name: OrgConfigProperties.TARGET_ORG, - key: OrgConfigProperties.TARGET_ORG, - value: 'MyUser', - location: 'Local', - success: true, - }, - { - name: OrgConfigProperties.ORG_API_VERSION, - key: OrgConfigProperties.ORG_API_VERSION, - value: '49.0', - location: 'Local', - success: true, - }, - ]); - }); + it('should return values for all configured properties', async () => { + stubMethod(sinon, ConfigAggregator.prototype, 'getConfigInfo').returns([ + { key: OrgConfigProperties.TARGET_DEV_HUB, value: 'MyDevhub', location: 'Global' }, + { key: SfConfigProperties.DISABLE_TELEMETRY, value: true, location: 'Global' }, + { key: OrgConfigProperties.TARGET_ORG, value: 'MyUser', location: 'Local' }, + { key: OrgConfigProperties.ORG_API_VERSION, value: '49.0', location: 'Local' }, + ]); - test - .do(() => { - stubMethod(sandbox, ConfigAggregator.prototype, 'getConfigInfo').returns([]); - }) - .stdout() - .command(['config:list', '--json']) - .it('should handle no results found', (ctx) => { - const { result } = JSON.parse(ctx.stdout); - expect(result).to.deep.equal([]); - }); + const { result } = await runCommand('config list'); + expect(result).to.deep.equal([ + { + name: OrgConfigProperties.TARGET_DEV_HUB, + key: OrgConfigProperties.TARGET_DEV_HUB, + value: 'MyDevhub', + location: 'Global', + path: undefined, + success: true, + }, + { + name: SfConfigProperties.DISABLE_TELEMETRY, + key: SfConfigProperties.DISABLE_TELEMETRY, + value: true, + location: 'Global', + path: undefined, + success: true, + }, + { + name: OrgConfigProperties.TARGET_ORG, + key: OrgConfigProperties.TARGET_ORG, + value: 'MyUser', + location: 'Local', + path: undefined, + success: true, + }, + { + name: OrgConfigProperties.ORG_API_VERSION, + key: OrgConfigProperties.ORG_API_VERSION, + value: '49.0', + location: 'Local', + path: undefined, + success: true, + }, + ]); + }); + + it('should handle no results found', async () => { + stubMethod(sinon, ConfigAggregator.prototype, 'getConfigInfo').returns([]); + const { result } = await runCommand('config list'); + expect(result).to.deep.equal([]); + }); }); diff --git a/test/commands/config/set.test.ts b/test/commands/config/set.test.ts index b62fdd97..eb4b0a8a 100644 --- a/test/commands/config/set.test.ts +++ b/test/commands/config/set.test.ts @@ -5,117 +5,114 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { test, expect } from '@oclif/test'; +import { expect } from 'chai'; +import { runCommand } from '@oclif/test'; import { Config, Org, OrgConfigProperties } from '@salesforce/core'; import { StubbedType, stubInterface, stubMethod } from '@salesforce/ts-sinon'; -import { SinonSandbox, SinonStub } from 'sinon'; import sinon from 'sinon'; describe('config:set', () => { let configStub: StubbedType; let orgStub: StubbedType; - let orgCreateSpy: SinonStub; - let sandbox: SinonSandbox; - - beforeEach(() => { - sandbox = sinon.createSandbox(); - }); + let orgCreateSpy: sinon.SinonStub; afterEach(() => { - sandbox.restore(); + sinon.restore(); }); async function prepareStubs() { - configStub = stubInterface(sandbox, {}); - stubMethod(sandbox, Config, 'create').callsFake(async () => configStub); + configStub = stubInterface(sinon, {}); + stubMethod(sinon, Config, 'create').callsFake(async () => configStub); } - test - .do(async () => prepareStubs()) - .stdout() - .command(['config:set', `${OrgConfigProperties.ORG_API_VERSION}=49.0`, '--global', '--json']) - .it('should return values for all configured properties', (ctx) => { - const { result } = JSON.parse(ctx.stdout); - expect(result).to.deep.equal({ - successes: [{ name: OrgConfigProperties.ORG_API_VERSION, value: '49.0', success: true }], - failures: [], - }); - expect(configStub.set.callCount).to.equal(1); + it('should return values for all configured properties', async () => { + await prepareStubs(); + const { result } = await runCommand(['config:set', `${OrgConfigProperties.ORG_API_VERSION}=49.0`, '--global']); + expect(result).to.deep.equal({ + successes: [{ name: OrgConfigProperties.ORG_API_VERSION, value: '49.0', success: true }], + failures: [], }); + expect(configStub.set.callCount).to.equal(1); + }); - test - .do(async () => { - await prepareStubs(); - orgStub = stubInterface(sandbox, {}); - orgCreateSpy = stubMethod(sandbox, Org, 'create').callsFake(async () => orgStub); - }) - .stdout() - .command(['config:set', `${OrgConfigProperties.TARGET_ORG}=MyUser`, '--global', '--json']) - .it('should instantiate an Org when target-org is set', (ctx) => { - const { result } = JSON.parse(ctx.stdout); - expect(result).to.deep.equal({ - failures: [], - successes: [{ name: OrgConfigProperties.TARGET_ORG, value: 'MyUser', success: true }], - }); - expect(configStub.set.callCount).to.equal(1); - expect(orgCreateSpy.callCount).to.equal(1); + it('should instantiate an Org when target-org is set', async () => { + await prepareStubs(); + orgStub = stubInterface(sinon, {}); + orgCreateSpy = stubMethod(sinon, Org, 'create').callsFake(async () => orgStub); + const { result } = await runCommand([ + 'config:set', + `${OrgConfigProperties.TARGET_ORG}=MyUser`, + '--global', + '--json', + ]); + expect(result).to.deep.equal({ + failures: [], + successes: [{ name: OrgConfigProperties.TARGET_ORG, value: 'MyUser', success: true }], }); + expect(configStub.set.callCount).to.equal(1); + expect(orgCreateSpy.callCount).to.equal(1); + }); - test - .do(async () => { - await prepareStubs(); - orgStub = stubInterface(sandbox, {}); - orgCreateSpy = stubMethod(sandbox, Org, 'create').callsFake(async () => orgStub); - }) - .stdout() - .command(['config:set', `${OrgConfigProperties.TARGET_DEV_HUB}=MyDevhub`, '--global', '--json']) - .it('should instantiate an Org when target-dev-hub is set', (ctx) => { - const { result } = JSON.parse(ctx.stdout); - expect(result).to.deep.equal({ - failures: [], - successes: [{ name: OrgConfigProperties.TARGET_DEV_HUB, value: 'MyDevhub', success: true }], - }); - expect(configStub.set.callCount).to.equal(1); - expect(orgCreateSpy.callCount).to.equal(1); + it('should instantiate an Org when target-dev-hub is set', async () => { + await prepareStubs(); + orgStub = stubInterface(sinon, {}); + orgCreateSpy = stubMethod(sinon, Org, 'create').callsFake(async () => orgStub); + const { result } = await runCommand([ + 'config:set', + `${OrgConfigProperties.TARGET_DEV_HUB}=MyDevhub`, + '--global', + '--json', + ]); + expect(result).to.deep.equal({ + failures: [], + successes: [{ name: OrgConfigProperties.TARGET_DEV_HUB, value: 'MyDevhub', success: true }], }); + expect(configStub.set.callCount).to.equal(1); + expect(orgCreateSpy.callCount).to.equal(1); + }); describe('error cases', () => { beforeEach(() => { - stubMethod(sandbox, Org, 'create').callsFake(async () => { + stubMethod(sinon, Org, 'create').callsFake(async () => { throw new Error('No AuthInfo found'); }); }); - test - .stdout() - .command(['config:set', `${OrgConfigProperties.TARGET_ORG}=NonExistentOrg`, '--global', '--json']) - .it('should handle failed org create with --json flag', (ctx) => { - const { result } = JSON.parse(ctx.stdout); - expect(result).to.deep.equal({ - successes: [], - failures: [ - { - error: { - cause: {}, - exitCode: 1, - name: 'Error', - }, - name: OrgConfigProperties.TARGET_ORG, - message: 'Invalid config value: org "NonExistentOrg" is not authenticated.', - success: false, - value: 'NonExistentOrg', + it('should handle failed org create with --json flag', async () => { + const { stdout } = await runCommand([ + 'config:set', + `${OrgConfigProperties.TARGET_ORG}=NonExistentOrg`, + '--global', + '--json', + ]); + const { result } = JSON.parse(stdout); + expect(result).to.deep.equal({ + successes: [], + failures: [ + { + error: { + cause: {}, + exitCode: 1, + name: 'Error', }, - ], - }); + name: OrgConfigProperties.TARGET_ORG, + message: 'Invalid config value: org "NonExistentOrg" is not authenticated.', + success: false, + value: 'NonExistentOrg', + }, + ], }); + }); - test - .stdout() - .command(['config:set', `${OrgConfigProperties.TARGET_ORG}=NonExistentOrg`, '--global']) - .it('should handle failed org create with no --json flag', (ctx) => { - expect(ctx.stdout).to.include(OrgConfigProperties.TARGET_ORG); - expect(ctx.stdout).to.include('NonExistentOrg'); - expect(ctx.stdout).to.include('false'); - }); + it('should handle failed org create with no --json flag', async () => { + const { stdout } = await runCommand([ + 'config:set', + `${OrgConfigProperties.TARGET_ORG}=NonExistentOrg`, + '--global', + ]); + expect(stdout).to.include(OrgConfigProperties.TARGET_ORG); + expect(stdout).to.include('NonExistentOrg'); + expect(stdout).to.include('false'); + }); }); }); diff --git a/test/commands/config/unset.test.ts b/test/commands/config/unset.test.ts index 12cc1e65..ed5bf588 100644 --- a/test/commands/config/unset.test.ts +++ b/test/commands/config/unset.test.ts @@ -4,7 +4,8 @@ * Licensed under the BSD 3-Clause license. * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import { test, expect } from '@oclif/test'; +import { expect } from 'chai'; +import { runCommand } from '@oclif/test'; import { Config, OrgConfigProperties } from '@salesforce/core'; import { StubbedType, stubInterface, stubMethod } from '@salesforce/ts-sinon'; import { SinonSandbox } from 'sinon'; @@ -36,70 +37,70 @@ describe('config:unset', () => { stubMethod(sandbox, Config, 'create').callsFake(async () => configStub); } - test - .do(async () => prepareStubs()) - .stdout() - .command(['config:unset', `${OrgConfigProperties.ORG_API_VERSION}`, '--global', '--json']) - .it('should unset values for a single property', (ctx) => { - const { result } = JSON.parse(ctx.stdout); - expect(result).to.deep.equal({ - failures: [], - successes: [{ name: OrgConfigProperties.ORG_API_VERSION, success: true }], - }); - expect(configStub.unset.callCount).to.equal(1); + it('should unset values for a single property', async () => { + await prepareStubs(); + const { result } = await runCommand([ + 'config:unset', + `${OrgConfigProperties.ORG_API_VERSION}`, + '--global', + '--json', + ]); + expect(result).to.deep.equal({ + failures: [], + successes: [{ name: OrgConfigProperties.ORG_API_VERSION, success: true }], }); + expect(configStub.unset.callCount).to.equal(1); + }); - test - .do(async () => prepareStubs()) - .stdout() - .command([ + it('should unset values for multiple properties', async () => { + await prepareStubs(); + const { result } = await runCommand([ 'config:unset', `${OrgConfigProperties.ORG_API_VERSION}`, `${OrgConfigProperties.TARGET_DEV_HUB}`, '--global', '--json', - ]) - .it('should unset values for multiple properties', (ctx) => { - const { result } = JSON.parse(ctx.stdout); - expect(result).to.deep.equal({ - successes: [ - { name: OrgConfigProperties.ORG_API_VERSION, success: true }, - { name: OrgConfigProperties.TARGET_DEV_HUB, success: true }, - ], - failures: [], - }); - expect(configStub.unset.callCount).to.equal(2); + ]); + expect(result).to.deep.equal({ + successes: [ + { name: OrgConfigProperties.ORG_API_VERSION, success: true }, + { name: OrgConfigProperties.TARGET_DEV_HUB, success: true }, + ], + failures: [], }); + expect(configStub.unset.callCount).to.equal(2); + }); - test - .do(async () => prepareStubs(true)) - .stdout() - .command(['config:unset', `${OrgConfigProperties.ORG_API_VERSION}`, '--global', '--json']) - .it('should handle errors with --json flag', (ctx) => { - const { result } = JSON.parse(ctx.stdout); - expect(result).to.deep.equal({ - successes: [], - failures: [ - { - error: { - cause: {}, - exitCode: 1, - name: 'Error', - }, - name: OrgConfigProperties.ORG_API_VERSION, - message: 'Unset Error!', - success: false, + it('should handle errors with --json flag', async () => { + await prepareStubs(true); + const { stdout } = await runCommand([ + 'config:unset', + `${OrgConfigProperties.ORG_API_VERSION}`, + '--global', + '--json', + ]); + const { result } = JSON.parse(stdout); + expect(result).to.deep.equal({ + successes: [], + failures: [ + { + name: OrgConfigProperties.ORG_API_VERSION, + message: 'Unset Error!', + success: false, + error: { + name: 'Error', + cause: {}, + exitCode: 1, }, - ], - }); + }, + ], }); + }); - test - .do(async () => prepareStubs(true)) - .stdout() - .command(['config:unset', `${OrgConfigProperties.ORG_API_VERSION}`, '--global']) - .it('should handle errors with no --json flag', (ctx) => { - expect(ctx.stdout).to.include(OrgConfigProperties.ORG_API_VERSION); - expect(ctx.stdout).to.include('false'); - }); + it('should handle errors with no --json flag', async () => { + await prepareStubs(true); + const { stdout } = await runCommand(['config:unset', `${OrgConfigProperties.ORG_API_VERSION}`, '--global']); + expect(stdout).to.include(OrgConfigProperties.ORG_API_VERSION); + expect(stdout).to.include('false'); + }); }); diff --git a/yarn.lock b/yarn.lock index 02631582..3582278f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1710,14 +1710,13 @@ http-call "^5.2.2" lodash "^4.17.21" -"@oclif/test@^3.2.15": - version "3.2.15" - resolved "https://registry.yarnpkg.com/@oclif/test/-/test-3.2.15.tgz#aaddb08dee841c3d6f86bfbea2a798cae0c3f499" - integrity sha512-XqG3RosozNqySkxSXInU12Xec2sPSOkqYHJDfdFZiWG3a8Cxu4dnPiAQvms+BJsOlLQmfEQlSHqiyVUKOMHhXA== +"@oclif/test@^4": + version "4.0.3" + resolved "https://registry.yarnpkg.com/@oclif/test/-/test-4.0.3.tgz#718d8aabe64aca6040cd4c6085a9e34f124768db" + integrity sha512-LxcRYVFTUHoOW2Koo1lmbEwl/4HRFIdNWXuUY1/PHEawjwLvp3xwVe2rOWGqYD+vlHr+TYUw2QDQc8e2vUTDrw== dependencies: - "@oclif/core" "^3.26.6" - chai "^4.4.1" - fancy-test "^3.0.15" + ansis "^3.2.0" + debug "^4.3.5" "@pkgjs/parseargs@^0.11.0": version "0.11.0" @@ -1997,13 +1996,6 @@ dependencies: type-detect "4.0.8" -"@sinonjs/fake-timers@^10.3.0": - version "10.3.0" - resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz#55fdff1ecab9f354019129daf4df0dd4d923ea66" - integrity sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA== - dependencies: - "@sinonjs/commons" "^3.0.0" - "@sinonjs/fake-timers@^11.2.2": version "11.2.2" resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-11.2.2.tgz#50063cc3574f4a27bd8453180a04171c85cc9699" @@ -2954,7 +2946,7 @@ "@types/node" "*" "@types/responselike" "^1.0.0" -"@types/chai@*", "@types/chai@^4.3.14": +"@types/chai@^4.3.14": version "4.3.14" resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.14.tgz#ae3055ea2be43c91c9fd700a36d67820026d96e6" integrity sha512-Wj71sXE4Q4AkGdG9Tvq1u/fquNz9EdG4LIJMwVVII7ashjD/8cf8fyIfJAjRr6YcsXnSE8cOGQPq1gqeR8z+3w== @@ -3020,11 +3012,6 @@ dependencies: "@types/node" "*" -"@types/lodash@*": - version "4.14.200" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.200.tgz#435b6035c7eba9cdf1e039af8212c9e9281e7149" - integrity sha512-YI/M/4HRImtNf3pJgbF+W6FrXovqj+T+/HpENLTooK9PnkacBsDpeP3IpHab40CClUfhNmdM2WTNP2sa2dni5Q== - "@types/minimatch@*": version "5.1.2" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-5.1.2.tgz#07508b45797cb81ec3f273011b054cd0755eddca" @@ -3091,7 +3078,7 @@ "@types/glob" "~7.2.0" "@types/node" "*" -"@types/sinon@*", "@types/sinon@^10.0.20": +"@types/sinon@^10.0.20": version "10.0.20" resolved "https://registry.yarnpkg.com/@types/sinon/-/sinon-10.0.20.tgz#f1585debf4c0d99f9938f4111e5479fb74865146" integrity sha512-2APKKruFNCAZgx3daAyACGzWuJ028VVCUDk6o2rw/Z4PXT0ogwdV4KUegW0MwVs0Zu59auPXbbuBJHF12Sx1Eg== @@ -3726,7 +3713,7 @@ cardinal@^2.1.1: ansicolors "~0.3.2" redeyed "~2.1.0" -chai@^4.3.10, chai@^4.4.1: +chai@^4.3.10: version "4.4.1" resolved "https://registry.yarnpkg.com/chai/-/chai-4.4.1.tgz#3603fa6eba35425b0f2ac91a009fe924106e50d1" integrity sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g== @@ -4256,7 +4243,7 @@ diff@^4.0.1, diff@^4.0.2: resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== -diff@^5.1.0, diff@^5.2.0: +diff@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/diff/-/diff-5.2.0.tgz#26ded047cd1179b78b9537d5ef725503ce1ae531" integrity sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A== @@ -4756,21 +4743,6 @@ extend@^3.0.2: resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== -fancy-test@^3.0.15: - version "3.0.16" - resolved "https://registry.yarnpkg.com/fancy-test/-/fancy-test-3.0.16.tgz#13f60771421ea93de94b1a1cac185c18021553bf" - integrity sha512-y1xZFpyYbE2TMiT+agOW2Emv8gr73zvDrKKbcXc8L+gMyIVJFn71cc4ICfzu2zEXjHirpHpdDJN0JBX99wwDXQ== - dependencies: - "@types/chai" "*" - "@types/lodash" "*" - "@types/node" "*" - "@types/sinon" "*" - lodash "^4.17.13" - mock-stdin "^1.0.0" - nock "^13.5.4" - sinon "^16.1.3" - stdout-stderr "^0.1.9" - fast-copy@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/fast-copy/-/fast-copy-3.0.1.tgz#9e89ef498b8c04c1cd76b33b8e14271658a732aa" @@ -6007,11 +5979,6 @@ json-stable-stringify-without-jsonify@^1.0.1: resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== -json-stringify-safe@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" - integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== - json5@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.2.tgz#63d98d60f21b313b77c4d6da18bfa69d80e1d593" @@ -6270,7 +6237,7 @@ lodash.upperfirst@^4.3.1: resolved "https://registry.yarnpkg.com/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz#1365edf431480481ef0d1c68957a5ed99d49f7ce" integrity sha512-sReKOYJIJf74dhJONhU4e0/shzi1trVbSWDOhKYE5XV2O+H7Sb2Dihwuc7xWxVl+DgFPyTqIN3zMfT9cq5iWDg== -lodash@^4.17.13, lodash@^4.17.15, lodash@^4.17.21: +lodash@^4.17.15, lodash@^4.17.21: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -6573,11 +6540,6 @@ mocha@^10.4.0: yargs-parser "20.2.4" yargs-unparser "2.0.0" -mock-stdin@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/mock-stdin/-/mock-stdin-1.0.0.tgz#efcfaf4b18077e14541742fd758b9cae4e5365ea" - integrity sha512-tukRdb9Beu27t6dN+XztSRHq9J0B/CoAOySGzHfn8UTfmqipA5yNT/sDUEyYdAV3Hpka6Wx6kOMxuObdOex60Q== - mri@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/mri/-/mri-1.2.0.tgz#6721480fec2a11a4889861115a48b6cbe7cc8f0b" @@ -6653,7 +6615,7 @@ nise@^4.1.0: just-extend "^4.0.2" path-to-regexp "^1.7.0" -nise@^5.1.4, nise@^5.1.9: +nise@^5.1.9: version "5.1.9" resolved "https://registry.yarnpkg.com/nise/-/nise-5.1.9.tgz#0cb73b5e4499d738231a473cd89bd8afbb618139" integrity sha512-qOnoujW4SV6e40dYxJOb3uvuoPHtmLzIk4TFo+j0jPJoC+5Z9xja5qH5JZobEPsa8+YYphMrOSwnrshEhG2qww== @@ -6672,15 +6634,6 @@ no-case@^3.0.4: lower-case "^2.0.2" tslib "^2.0.3" -nock@^13.5.4: - version "13.5.4" - resolved "https://registry.yarnpkg.com/nock/-/nock-13.5.4.tgz#8918f0addc70a63736170fef7106a9721e0dc479" - integrity sha512-yAyTfdeNJGGBFxWdzSKCBYxs5FxLbCg5X5Q4ets974hcQzG1+qCxvIyOo4j2Ry6MUlhWVMX4OoYDefAIIwupjw== - dependencies: - debug "^4.1.0" - json-stringify-safe "^5.0.1" - propagate "^2.0.0" - node-emoji@^1.10.0: version "1.11.0" resolved "https://registry.yarnpkg.com/node-emoji/-/node-emoji-1.11.0.tgz#69a0150e6946e2f115e9d7ea4df7971e2628301c" @@ -7242,11 +7195,6 @@ process@^0.11.10: resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" integrity sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A== -propagate@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/propagate/-/propagate-2.0.1.tgz#40cdedab18085c792334e64f0ac17256d38f9a45" - integrity sha512-vGrhOavPSTz4QVNuBNdcNXePNdNMaO1xj9yBeH1ScQPjk/rhg9sSlCXPhMkFuaNNW/syTvYqsnbIJxMBfRbbag== - proper-lockfile@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/proper-lockfile/-/proper-lockfile-4.1.2.tgz#c8b9de2af6b2f1601067f98e01ac66baa223141f" @@ -7755,18 +7703,6 @@ sinon@10.0.0: nise "^4.1.0" supports-color "^7.1.0" -sinon@^16.1.3: - version "16.1.3" - resolved "https://registry.yarnpkg.com/sinon/-/sinon-16.1.3.tgz#b760ddafe785356e2847502657b4a0da5501fba8" - integrity sha512-mjnWWeyxcAf9nC0bXcPmiDut+oE8HYridTNzBbF98AYVLmWwGRp2ISEpyhYflG1ifILT+eNn3BmKUJPxjXUPlA== - dependencies: - "@sinonjs/commons" "^3.0.0" - "@sinonjs/fake-timers" "^10.3.0" - "@sinonjs/samsam" "^8.0.0" - diff "^5.1.0" - nise "^5.1.4" - supports-color "^7.2.0" - sinon@^17.0.2: version "17.0.2" resolved "https://registry.yarnpkg.com/sinon/-/sinon-17.0.2.tgz#470894bcc2d24b01bad539722ea46da949892405" @@ -7966,24 +7902,7 @@ srcset@^5.0.0: resolved "https://registry.yarnpkg.com/srcset/-/srcset-5.0.0.tgz#9df6c3961b5b44a02532ce6ae4544832609e2e3f" integrity sha512-SqEZaAEhe0A6ETEa9O1IhSPC7MdvehZtCnTR0AftXk3QhY2UNgb+NApFOUPZILXk/YTDfFxMTNJOBpzrJsEdIA== -stdout-stderr@^0.1.9: - version "0.1.13" - resolved "https://registry.yarnpkg.com/stdout-stderr/-/stdout-stderr-0.1.13.tgz#54e3450f3d4c54086a49c0c7f8786a44d1844b6f" - integrity sha512-Xnt9/HHHYfjZ7NeQLvuQDyL1LnbsbddgMFKCuaQKwGCdJm8LnstZIXop+uOY36UR1UXXoHXfMbC1KlVdVd2JLA== - dependencies: - debug "^4.1.1" - strip-ansi "^6.0.0" - -"string-width-cjs@npm:string-width@^4.2.0": - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -8051,14 +7970,7 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-ansi@6.0.1, strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@6.0.1, strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -8118,7 +8030,7 @@ supports-color@^5.3.0, supports-color@^5.4.0: dependencies: has-flag "^3.0.0" -supports-color@^7, supports-color@^7.0.0, supports-color@^7.1.0, supports-color@^7.2.0: +supports-color@^7, supports-color@^7.0.0, supports-color@^7.1.0: version "7.2.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== @@ -8609,7 +8521,7 @@ workerpool@6.2.1: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -8627,15 +8539,6 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"