File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -206,6 +206,20 @@ describe('apex run test', () => {
206206 execCmd ( `apex:get:test -i ${ result ?. testRunId } ` , { ensureExitCode : 0 } ) ;
207207 } ) ;
208208
209+ it ( 'will save test-run-id file for async' , async ( ) => {
210+ const resultDir = 'asyncResults' ;
211+ const result = execCmd < TestRunIdResult > ( `apex:run:test --json --output-dir ${ resultDir } ` , { ensureExitCode : 0 } )
212+ . jsonOutput ?. result ;
213+ expect ( result ?. testRunId ) . to . be . a ( 'string' ) ;
214+ expect ( result ?. testRunId . startsWith ( '707' ) ) . to . be . true ;
215+ const outputDir = path . join ( session . project . dir , resultDir ) ;
216+ const testRunIdFile = path . join ( outputDir , 'test-run-id.txt' ) ;
217+ expect ( fs . existsSync ( testRunIdFile ) ) . to . be . true ;
218+ expect ( await fs . promises . readFile ( testRunIdFile , 'utf-8' ) ) . equal ( result ?. testRunId ) ;
219+ // get the test results to make sure it's not 'ALREADY IN PROGRESS' or 'QUEUED' for the next test
220+ execCmd ( `apex:get:test -i ${ result ?. testRunId } ` , { ensureExitCode : 0 } ) ;
221+ } ) ;
222+
209223 it ( 'will run default tests and default async' , async ( ) => {
210224 const result = execCmd ( 'apex:run:test' , { ensureExitCode : 0 } ) . shellOutput . stdout ;
211225 expect ( result ) . to . include ( 'apex get test -i 707' ) ;
You can’t perform that action at this time.
0 commit comments