Skip to content

Commit 8e75bba

Browse files
fix: restore run tests async by default
1 parent 1b921db commit 8e75bba

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

src/commands/apex/run/test.ts

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -242,31 +242,9 @@ export default class Test extends SfCommand<RunCommandResult> {
242242
return (await testService.runTestAsynchronous(
243243
payload,
244244
flags['code-coverage'],
245-
shouldImmediatelyReturn(flags.synchronous, flags['result-format'], flags.json, flags.wait),
245+
flags.wait ? false : !(flags.synchronous && !this.jsonEnabled()),
246246
undefined,
247247
this.cancellationTokenSource.token
248248
)) as TestRunIdResult;
249249
}
250250
}
251-
/**
252-
* Handles special exceptions where we don't want to return early
253-
* with the testRunId.
254-
**/
255-
const shouldImmediatelyReturn = (
256-
synchronous?: boolean,
257-
resultFormatFlag?: string,
258-
json?: boolean,
259-
wait?: Duration
260-
): boolean => {
261-
if (resultFormatFlag !== undefined) {
262-
return false;
263-
}
264-
265-
// when the user has explictly asked to wait for results, but didn't give a format
266-
if (wait) {
267-
return false;
268-
}
269-
270-
// historical expectation to wait for results from a synchronous test run
271-
return !(synchronous && !json);
272-
};

0 commit comments

Comments
 (0)