@@ -10,14 +10,14 @@ import { MockTestOrgData, TestContext } from '@salesforce/core/lib/testSetup';
1010import { config , expect } from 'chai' ;
1111import { stubPrompter , stubSfCommandUx } from '@salesforce/sf-plugins-core' ;
1212import { SandboxAccessor } from '@salesforce/core/lib/stateAggregator/accessors/sandboxAccessor' ;
13- import { Delete } from '../../../../src/commands/force/org/delete' ;
13+ import { Delete as LegacyDelete } from '../../../../src/commands/force/org/delete' ;
1414
1515config . truncateThreshold = 0 ;
1616
1717Messages . importMessagesDirectory ( __dirname ) ;
1818const messages = Messages . loadMessages ( '@salesforce/plugin-org' , 'delete' ) ;
1919
20- describe ( 'org:delete' , ( ) => {
20+ describe ( '[DEPRECATED] force: org:delete' , ( ) => {
2121 const $$ = new TestContext ( ) ;
2222 const testOrg = new MockTestOrgData ( ) ;
2323 const testHub = new MockTestOrgData ( ) ;
@@ -35,7 +35,7 @@ describe('org:delete', () => {
3535 it ( 'will throw an error when no default set' , async ( ) => {
3636 await $$ . stubConfig ( { } ) ;
3737 try {
38- await Delete . run ( ) ;
38+ await LegacyDelete . run ( ) ;
3939 expect . fail ( 'should have thrown an error' ) ;
4040 } catch ( e ) {
4141 const err = e as SfError ;
@@ -46,7 +46,7 @@ describe('org:delete', () => {
4646
4747 it ( 'will prompt before attempting to delete' , async ( ) => {
4848 await $$ . stubConfig ( { 'target-org' : testOrg . username } ) ;
49- const res = await Delete . run ( [ ] ) ;
49+ const res = await LegacyDelete . run ( [ ] ) ;
5050 expect ( prompterStubs . confirm . calledOnce ) . to . equal ( true ) ;
5151 expect ( prompterStubs . confirm . firstCall . args [ 0 ] ) . to . equal (
5252 messages . getMessage ( 'confirmDelete' , [ 'scratch' , testOrg . username ] )
@@ -57,7 +57,7 @@ describe('org:delete', () => {
5757 it ( 'will resolve a default alias' , async ( ) => {
5858 await $$ . stubConfig ( { 'target-org' : 'myAlias' } ) ;
5959 $$ . stubAliases ( { myAlias : testOrg . username } ) ;
60- const res = await Delete . run ( [ ] ) ;
60+ const res = await LegacyDelete . run ( [ ] ) ;
6161 expect ( prompterStubs . confirm . calledOnce ) . to . equal ( true ) ;
6262 expect ( prompterStubs . confirm . firstCall . args [ 0 ] ) . to . equal (
6363 messages . getMessage ( 'confirmDelete' , [ 'scratch' , testOrg . username ] )
@@ -67,7 +67,7 @@ describe('org:delete', () => {
6767
6868 it ( 'will determine sandbox vs scratch org and delete sandbox' , async ( ) => {
6969 $$ . SANDBOX . stub ( SandboxAccessor . prototype , 'hasFile' ) . resolves ( true ) ;
70- const res = await Delete . run ( [ '--target-org' , testOrg . username ] ) ;
70+ const res = await LegacyDelete . run ( [ '--target-org' , testOrg . username ] ) ;
7171 expect ( prompterStubs . confirm . calledOnce ) . to . equal ( true ) ;
7272 expect ( prompterStubs . confirm . firstCall . args [ 0 ] ) . to . equal (
7373 messages . getMessage ( 'confirmDelete' , [ 'sandbox' , testOrg . username ] )
@@ -78,7 +78,7 @@ describe('org:delete', () => {
7878 it ( 'will NOT prompt before deleting scratch org when flag is provided' , async ( ) => {
7979 $$ . SANDBOX . stub ( Org . prototype , 'isSandbox' ) . resolves ( false ) ;
8080 $$ . SANDBOX . stub ( Org . prototype , 'delete' ) . resolves ( ) ;
81- const res = await Delete . run ( [ '--noprompt' , '--target-org' , testOrg . username ] ) ;
81+ const res = await LegacyDelete . run ( [ '--noprompt' , '--target-org' , testOrg . username ] ) ;
8282 expect ( prompterStubs . confirm . calledOnce ) . to . equal ( false ) ;
8383 expect ( sfCommandUxStubs . log . callCount ) . to . equal ( 1 ) ;
8484 expect ( sfCommandUxStubs . log . getCalls ( ) . flatMap ( ( call ) => call . args ) ) . to . deep . include (
@@ -90,7 +90,7 @@ describe('org:delete', () => {
9090 it ( 'will NOT prompt before deleting sandbox when flag is provided' , async ( ) => {
9191 $$ . SANDBOX . stub ( SandboxAccessor . prototype , 'hasFile' ) . resolves ( true ) ;
9292 $$ . SANDBOX . stub ( Org . prototype , 'delete' ) . resolves ( ) ;
93- const res = await Delete . run ( [ '--noprompt' , '--target-org' , testOrg . username ] ) ;
93+ const res = await LegacyDelete . run ( [ '--noprompt' , '--target-org' , testOrg . username ] ) ;
9494 expect ( prompterStubs . confirm . calledOnce ) . to . equal ( false ) ;
9595 expect ( sfCommandUxStubs . log . callCount ) . to . equal ( 1 ) ;
9696 expect ( sfCommandUxStubs . log . getCalls ( ) . flatMap ( ( call ) => call . args ) ) . to . deep . include (
@@ -102,7 +102,7 @@ describe('org:delete', () => {
102102 it ( 'will catch the ScratchOrgNotFound and wrap correctly' , async ( ) => {
103103 $$ . SANDBOX . stub ( Org . prototype , 'isSandbox' ) . resolves ( false ) ;
104104 $$ . SANDBOX . stub ( Org . prototype , 'delete' ) . throws ( new SfError ( 'bah!' , 'ScratchOrgNotFound' ) ) ;
105- const res = await Delete . run ( [ '--noprompt' , '--target-org' , testOrg . username ] ) ;
105+ const res = await LegacyDelete . run ( [ '--noprompt' , '--target-org' , testOrg . username ] ) ;
106106 expect ( prompterStubs . confirm . calledOnce ) . to . equal ( false ) ;
107107 expect ( res ) . to . deep . equal ( { orgId : testOrg . orgId , username : testOrg . username } ) ;
108108 expect ( sfCommandUxStubs . log . getCalls ( ) . flatMap ( ( call ) => call . args ) ) . to . deep . include (
@@ -113,7 +113,7 @@ describe('org:delete', () => {
113113 it ( 'will catch the SandboxNotFound and wrap correctly' , async ( ) => {
114114 $$ . SANDBOX . stub ( SandboxAccessor . prototype , 'hasFile' ) . resolves ( true ) ;
115115 $$ . SANDBOX . stub ( Org . prototype , 'delete' ) . throws ( new SfError ( 'bah!' , 'SandboxNotFound' ) ) ;
116- const res = await Delete . run ( [ '--noprompt' , '--target-org' , testOrg . username ] ) ;
116+ const res = await LegacyDelete . run ( [ '--noprompt' , '--target-org' , testOrg . username ] ) ;
117117 expect ( prompterStubs . confirm . called ) . to . equal ( false ) ;
118118 expect ( res ) . to . deep . equal ( { orgId : testOrg . orgId , username : testOrg . username } ) ;
119119 expect (
0 commit comments