diff --git a/src/testkit.ts b/src/testkit.ts index 35a6e2ca..4904d1dc 100644 --- a/src/testkit.ts +++ b/src/testkit.ts @@ -571,8 +571,10 @@ export const COMMANDS = { const getDefaultUsername = async (): Promise => { const configVar = 'target-org'; - const configResult = execCmd>(`config:get ${configVar} --json`) - .jsonOutput?.result; + const configResult = execCmd>( + `config:get ${configVar} --json`, + { ensureExitCode: 0, cli: 'sf' } + ).jsonOutput?.result; // depending on which version of config:get the user has available, there may be a name or key // eventually, drop the `key` option and the deprecated SfdxPropertyKeys const possibleKeys = [configVar, SfdxPropertyKeys.DEFAULT_USERNAME];