@@ -10,7 +10,7 @@ import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit';
10
10
import { OrgConfigProperties } from '@salesforce/core' ;
11
11
import { expect } from 'chai' ;
12
12
13
- describe ( 'package create and delete' , ( ) => {
13
+ describe ( 'package create/update/ delete' , ( ) => {
14
14
let session : TestSession ;
15
15
let devHubUsernameOrAlias : string ;
16
16
let pkgName : string ;
@@ -29,7 +29,7 @@ describe('package create and delete', () => {
29
29
after ( async ( ) => {
30
30
await session ?. clean ( ) ;
31
31
} ) ;
32
- describe ( 'create/delete - human results' , ( ) => {
32
+ describe ( 'create/update/ delete - human results' , ( ) => {
33
33
before ( async ( ) => {
34
34
pkgName = `test-pkg-${ Date . now ( ) } ` ;
35
35
} ) ;
@@ -40,14 +40,20 @@ describe('package create and delete', () => {
40
40
expect ( output ) . to . contain ( '=== Ids' ) ;
41
41
expect ( output ) . to . match ( / P a c k a g e I d \s + ?0 H o / ) ;
42
42
} ) ;
43
+ it ( 'should update a package - human readable results' , function ( ) {
44
+ const command = `force:package:beta:update --package ${ pkgName } --description "My new description" -v ${ devHubUsernameOrAlias } ` ;
45
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
46
+ const output = execCmd ( command , { ensureExitCode : 0 } ) . shellOutput . stdout as string ;
47
+ expect ( output ) . to . match ( / S u c c e s s f u l l y u p d a t e d t h e p a c k a g e \. \s + 0 H o / ) ;
48
+ } ) ;
43
49
it ( 'should delete a package - human readable results' , function ( ) {
44
50
const command = `force:package:beta:delete -p ${ pkgName } -v ${ devHubUsernameOrAlias } --noprompt` ;
45
51
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
46
52
const output = execCmd ( command , { ensureExitCode : 0 } ) . shellOutput . stdout as string ;
47
53
expect ( output ) . to . contain ( 'Successfully deleted the package. 0Ho' ) ;
48
54
} ) ;
49
55
} ) ;
50
- describe ( 'create/delete - json results' , ( ) => {
56
+ describe ( 'create/update/ delete - json results' , ( ) => {
51
57
before ( async ( ) => {
52
58
pkgName = `test-pkg-${ Date . now ( ) } ` ;
53
59
} ) ;
@@ -59,6 +65,14 @@ describe('package create and delete', () => {
59
65
expect ( output . result ) . to . have . property ( 'Id' ) ;
60
66
expect ( output . result . Id ) . to . match ( / 0 H o .{ 12 , 15 } / ) ;
61
67
} ) ;
68
+ it ( 'should update a package - json results' , function ( ) {
69
+ const command = `force:package:beta:update --package ${ pkgName } --description "My new description" -v ${ devHubUsernameOrAlias } --json` ;
70
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
71
+ const output = execCmd < { id : string } > ( command , { ensureExitCode : 0 } ) . jsonOutput ;
72
+ expect ( output . status ) . to . equal ( 0 ) ;
73
+ expect ( output . result ) . to . have . property ( 'id' ) ;
74
+ expect ( output . result . id ) . to . match ( / 0 H o .{ 12 , 15 } / ) ;
75
+ } ) ;
62
76
it ( 'should delete a package - json results' , function ( ) {
63
77
const command = `force:package:beta:delete -p ${ pkgName } -v ${ devHubUsernameOrAlias } --json` ;
64
78
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
0 commit comments