Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
"dependencies": {
"@salesforce/apex-node": "^8.1.19",
"@salesforce/core": "^8.8.5",
"@salesforce/kit": "^3.2.2",
"@salesforce/sf-plugins-core": "^12",
"@salesforce/kit": "^3.2.3",
"@salesforce/sf-plugins-core": "^12.2.1",
"ansis": "^3.3.1"
},
"devDependencies": {
"@oclif/core": "^4.0.34",
"@oclif/plugin-command-snapshot": "^5.2.23",
"@oclif/core": "^4.2.10",
"@oclif/plugin-command-snapshot": "^5.2.37",
"@salesforce/cli-plugins-testkit": "^5.3.39",
"@salesforce/dev-scripts": "^10.2.11",
"@salesforce/plugin-command-reference": "^3.1.43",
"@salesforce/plugin-command-reference": "^3.1.48",
"eslint-plugin-sf-plugin": "^1.20.16",
"oclif": "^4.17.30",
"oclif": "^4.17.37",
"ts-node": "^10.9.2",
"typescript": "^5.7.3"
},
Expand Down
28 changes: 19 additions & 9 deletions src/commands/apex/run/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,15 +201,25 @@ export default class Test extends SfCommand<RunCommandResult> {
skipCodeCoverage: !flags['code-coverage'],
};

// cast as TestRunIdResult because we're building an async payload which will return an async result
return (await testService.runTestAsynchronous(
payload,
flags['code-coverage'],
flags.wait && flags.wait.minutes > 0 ? false : !(flags.synchronous && !this.jsonEnabled()),
undefined,
this.cancellationTokenSource.token,
flags.wait
)) as TestRunIdResult;
try {
// cast as TestRunIdResult because we're building an async payload which will return an async result
return (await testService.runTestAsynchronous(
payload,
flags['code-coverage'],
flags.wait && flags.wait.minutes > 0 ? false : !(flags.synchronous && !this.jsonEnabled()),
undefined,
this.cancellationTokenSource.token,
flags.wait
)) as TestRunIdResult;
} catch (e) {
const error = SfError.wrap(e);
if (error.message.includes('Always provide a classes, suites, tests, or testLevel property')) {
error.message = 'There are no apex tests to run in the org';
error.actions = ['Ensure Apex Tests exist in the org'];
}

throw error;
}
}
}

Expand Down
Loading