Skip to content

Commit

Permalink
fix(apextests): handle conditions where test results are inaccurate f…
Browse files Browse the repository at this point in the history
…rom salesforce
  • Loading branch information
azlam-abdulsalam committed Sep 18, 2023
1 parent b9b8c88 commit 6e18ba6
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion packages/core/src/apextest/TriggerApexTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,23 @@ export default class TriggerApexTests {
testResult = this.removeDuplicateTestListing(testResult);

//Write Test Results to file
let jsonOutput = this.writeTestOutput(testResult);
let jsonOutput = {};
try
{
jsonOutput = this.writeTestOutput(testResult);
}catch(error)
{
SFPLogger.log(
`Unable to write test results to file due to ${error}`,
LoggerLevel.DEBUG,
this.fileLogger
);
return {
result: false,
id: testResult.summary.testRunId,
message: 'Unable to fetch test execution results, Please retry',
};
}

//Print tests result to screen
let testReportDisplayer = new TestReportDisplayer(jsonOutput, this.testOptions, this.fileLogger);
Expand Down

0 comments on commit 6e18ba6

Please sign in to comment.