Skip to content

Commit

Permalink
fix(*): fix divide by zero error
Browse files Browse the repository at this point in the history
  • Loading branch information
harishsaini committed Mar 28, 2024
1 parent fa92494 commit f165f37
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/fastlane/plugin/fueled/helper/fueled_helper.rb
Expand Up @@ -204,8 +204,12 @@ def self.calculate_code_coverage_percentage(
end
end
end

total_code_coverage_percentage = code_coverage_percentage / number_of_files

if number_of_files == 0
UI.important("No files/tests were found, please check if this is intentional")
end

total_code_coverage_percentage = number_of_files > 0 ? code_coverage_percentage / number_of_files : 100
file_message = number_of_files > 1 ? "files" : "file"
UI.message("Checked code coverage on #{number_of_files} #{file_message} with total percentage of #{total_code_coverage_percentage}%")

Expand Down

0 comments on commit f165f37

Please sign in to comment.