Skip to content

Commit

Permalink
Merge pull request #52 from Fueled/fix
Browse files Browse the repository at this point in the history
fix(*): fix divide by zero error
  • Loading branch information
harishsaini committed Mar 28, 2024
2 parents fa92494 + f165f37 commit 4ceb23a
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 4ceb23a

Please sign in to comment.