function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
uma52551.3972270309784705E12uma52551.3972270309784705E12 

Apex Trigger code Coverage

Hi All,

After Keeping if(!Test.isRunningtest()) to escape from the test class failure can we achive 100% code covarage on our trigger? I am having only 93% code covarage to my trigger. It has to be 100% to deploy this in prod. Any Suggestion how to gain 100% without removing 'if(!Test.isRunningtest())' Thanks!
StephenKennyStephenKenny
Can you post your trigger so we can see what is inside / outside of this code block? It should be possible to bring the coverage up but it depends on the code you have in your trigger. If it is alot, you may need to rewrite a large portion of it, or move all of the logic into a trigger handler class. You may decide the benifit it is not worth the effort in the end.