44 * Licensed under the BSD 3-Clause license.
55 * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
66 */
7- import { dirname , resolve } from 'node:path' ;
8- import { fileURLToPath } from 'node:url' ;
97import fs from 'node:fs' ;
108import { Messages , Org } from '@salesforce/core' ;
119import sinon from 'sinon' ;
@@ -30,11 +28,10 @@ let styledJsonStub: sinon.SinonStub;
3028
3129describe ( 'apex:test:run' , ( ) => {
3230 let sandbox : sinon . SinonSandbox ;
33- const config = new Config ( { root : resolve ( dirname ( fileURLToPath ( import . meta. url ) ) , '../../package.json' ) } ) ;
34- // give it an sfdx bin for now
35- config . bin = 'sfdx' ;
31+ let config : Config ;
3632
3733 beforeEach ( async ( ) => {
34+ config = await Config . load ( import . meta. url ) ;
3835 sandbox = sinon . createSandbox ( ) ;
3936 logStub = sandbox . stub ( Ux . prototype , 'log' ) ;
4037 styledJsonStub = sandbox . stub ( Ux . prototype , 'styledJSON' ) ;
@@ -76,7 +73,7 @@ describe('apex:test:run', () => {
7673 expect ( result ) . to . deep . equal ( testRunWithFailuresResult ) ;
7774 expect ( logStub . firstCall . args [ 0 ] ) . to . include ( '1..1' ) ;
7875 expect ( logStub . firstCall . args [ 0 ] ) . to . include ( 'ok 1 MyApexTests.testConfig' ) ;
79- expect ( logStub . firstCall . args [ 0 ] ) . to . include ( '# Run "sfdx apex get test -i 707' ) ;
76+ expect ( logStub . firstCall . args [ 0 ] ) . to . include ( '# Run "sf apex get test -i 707' ) ;
8077 } ) ;
8178
8279 it ( 'should return a success junit format message with async' , async ( ) => {
@@ -327,7 +324,7 @@ describe('apex:test:run', () => {
327324 expect ( result ) . to . deep . equal ( testRunSimpleResult ) ;
328325 expect ( logStub . firstCall . args [ 0 ] ) . to . include ( '1..1' ) ;
329326 expect ( logStub . firstCall . args [ 0 ] ) . to . include ( 'ok 1 MyApexTests.testConfig' ) ;
330- expect ( logStub . firstCall . args [ 0 ] ) . to . include ( '# Run "sfdx apex get test -i 707' ) ;
327+ expect ( logStub . firstCall . args [ 0 ] ) . to . include ( '# Run "sf apex get test -i 707' ) ;
331328 } ) ;
332329
333330 it ( 'should return a success junit format message with async' , async ( ) => {
0 commit comments