Skip to content
This repository has been archived by the owner on Mar 18, 2024. It is now read-only.

Commit

Permalink
fix(apextests): add error handling to replace
Browse files Browse the repository at this point in the history
This is probably an incorrect fix, will fix as more details emerge. Just return the original one in case replacement fails
  • Loading branch information
azlam-abdulsalam committed Sep 14, 2023
1 parent 56644a6 commit a08d135
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions packages/core/src/apextest/TriggerApexTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -457,20 +457,31 @@ export default class TriggerApexTests {
private fixBadNamespaceClassFullNames(testResult: any): any {
let modifiedTestResult = _.cloneDeep(testResult);

try
{
modifiedTestResult.tests = modifiedTestResult.tests.map((test) => {
return {
...test,
...{
fullName: test.fullName.replace('__', '.'),
fullName: test.fullName?.replace('__', '.'),
apexClass: {
...test.apexClass,
...{
fullName: test.apexClass.fullName.replace('__', '.'),
fullName: test.apexClass?.fullName?.replace('__', '.'),
},
},
},
};
});
}catch(error)
{
SFPLogger.log(
`Unable to fix bad namespace class full names due to ${error}`,
LoggerLevel.DEBUG,
this.fileLogger
);
modifiedTestResult = _.cloneDeep(testResult);
}

return modifiedTestResult;
}
Expand Down

0 comments on commit a08d135

Please sign in to comment.