66 */
77
88import { SourceTestkit } from '@salesforce/source-testkit' ;
9- import { assert } from 'chai' ;
9+ import { assert , config } from 'chai' ;
10+ import { execCmd } from '@salesforce/cli-plugins-testkit' ;
1011import { DeployResultJson } from '../../../../src/utils/types' ;
12+ config . truncateThreshold = 0 ;
1113
1214describe ( 'deploy metadata quick NUTs' , ( ) => {
1315 let testkit : SourceTestkit ;
@@ -25,49 +27,59 @@ describe('deploy metadata quick NUTs', () => {
2527
2628 describe ( '--use-most-recent' , ( ) => {
2729 it ( 'should deploy previously validated deployment' , async ( ) => {
28- const validation = await testkit . execute < DeployResultJson > ( 'deploy:metadata :validate' , {
30+ const validation = await testkit . execute < DeployResultJson > ( 'project:deploy :validate' , {
2931 args : '--source-dir force-app' ,
3032 json : true ,
3133 exitCode : 0 ,
3234 } ) ;
3335 assert ( validation ) ;
34- await testkit . expect . filesToBeDeployedViaResult (
35- [ 'force-app/**/*' ] ,
36- [ 'force-app/test/**/*' ] ,
37- validation . result . files
38- ) ;
36+ await testkit . expect . filesToBeDeployed ( [ 'force-app/**/*' ] , [ 'force-app/test/**/*' ] ) ;
3937
40- const deploy = await testkit . execute < DeployResultJson > ( 'deploy:metadata :quick' , {
38+ const deploy = await testkit . execute < DeployResultJson > ( 'project:deploy :quick' , {
4139 args : '--use-most-recent' ,
4240 json : true ,
4341 exitCode : 0 ,
4442 } ) ;
4543 assert ( deploy ) ;
46- await testkit . expect . filesToBeDeployedViaResult ( [ 'force-app/**/*' ] , [ 'force-app/test/**/*' ] , deploy . result . files ) ;
44+ await testkit . expect . filesToBeDeployed ( [ 'force-app/**/*' ] , [ 'force-app/test/**/*' ] ) ;
45+ } ) ;
46+ it ( 'should deploy previously validated deployment with metadata format' , async ( ) => {
47+ execCmd ( 'project:convert:source --source-dir force-app --output-dir metadata' ) ;
48+ const validation = await testkit . execute < DeployResultJson > ( 'project:deploy:validate' , {
49+ args : '--metadata-dir metadata' ,
50+ json : true ,
51+ exitCode : 0 ,
52+ } ) ;
53+ assert ( validation ) ;
54+ await testkit . expect . filesToBeDeployed ( [ 'force-app/**/*' ] , [ 'force-app/test/**/*' ] ) ;
55+
56+ const deploy = await testkit . execute < DeployResultJson > ( 'project:deploy:quick' , {
57+ args : '--use-most-recent' ,
58+ json : true ,
59+ exitCode : 0 ,
60+ } ) ;
61+ assert ( deploy ) ;
62+ await testkit . expect . filesToBeDeployed ( [ 'force-app/**/*' ] , [ 'force-app/test/**/*' ] ) ;
4763 } ) ;
4864 } ) ;
4965
5066 describe ( '--job-id' , ( ) => {
5167 it ( 'should deploy previously validated deployment' , async ( ) => {
52- const validation = await testkit . execute < DeployResultJson > ( 'deploy:metadata :validate' , {
68+ const validation = await testkit . execute < DeployResultJson > ( 'project:deploy :validate' , {
5369 args : '--source-dir force-app' ,
5470 json : true ,
5571 exitCode : 0 ,
5672 } ) ;
5773 assert ( validation ) ;
58- await testkit . expect . filesToBeDeployedViaResult (
59- [ 'force-app/**/*' ] ,
60- [ 'force-app/test/**/*' ] ,
61- validation . result . files
62- ) ;
74+ await testkit . expect . filesToBeDeployed ( [ 'force-app/**/*' ] , [ 'force-app/test/**/*' ] ) ;
6375
64- const deploy = await testkit . execute < DeployResultJson > ( 'deploy:metadata :quick' , {
76+ const deploy = await testkit . execute < DeployResultJson > ( 'project:deploy :quick' , {
6577 args : `--job-id ${ validation . result . id } ` ,
6678 json : true ,
6779 exitCode : 0 ,
6880 } ) ;
6981 assert ( deploy ) ;
70- await testkit . expect . filesToBeDeployedViaResult ( [ 'force-app/**/*' ] , [ 'force-app/test/**/*' ] , deploy . result . files ) ;
82+ await testkit . expect . filesToBeDeployed ( [ 'force-app/**/*' ] , [ 'force-app/test/**/*' ] ) ;
7183 } ) ;
7284
7385 it ( 'should fail to deploy previously deployed deployment' , async ( ) => {
@@ -77,7 +89,7 @@ describe('deploy metadata quick NUTs', () => {
7789 exitCode : 0 ,
7890 } ) ;
7991 assert ( first ) ;
80- const deploy = await testkit . execute < DeployResultJson > ( 'deploy:metadata :quick' , {
92+ const deploy = await testkit . execute < DeployResultJson > ( 'project:deploy :quick' , {
8193 args : `--job-id ${ first . result . id } ` ,
8294 json : true ,
8395 exitCode : 1 ,
0 commit comments