def report
      return if failures.nil? # because danger calls `report` before loading a file
      warn("Skipped #{skipped.count} tests.") if show_skipped_tests && skipped.count > 0

      unless failures.empty? && errors.empty?
        fail('Tests have failed, see below for more information.', sticky: false)
        message = "### Tests: \n\n"

        tests = (failures + errors)

        common_attributes = tests.map{|test| test.attributes.keys }.inject(&:&)

        # check the provided headers are available
        unless headers.nil?
          not_available_headers = headers.select { |header| not common_attributes.include?(header) }
          raise "Some of headers provided aren't available in the JUnit report (#{not_available_headers})" unless not_available_headers.empty?
        end

        keys = headers || common_attributes
        attributes = keys.map(&:to_s).map(&:capitalize)

        # Create the headers
        message << attributes.join(' | ') + "|\n"
        message << attributes.map { |_| '---' }.join(' | ') + "|\n"

        # Map out the keys to the tests
        tests.each do |test|
          row_values = keys.map { |key| test.attributes[key] }.map { |v| auto_link(v) }
          message << row_values.join(' | ') + "|\n"
        end

        markdown message
      end
    end
def report
      return if failures.nil? # because danger calls `report` before loading a file
      warn("Skipped #{skipped.count} tests.") if show_skipped_tests && skipped.count > 0

      unless failures.empty? && errors.empty?
        fail('Tests have failed, see below for more information.', sticky: false)
        message = "### Tests: \n\n"

        tests = (failures + errors)

        common_attributes = tests.map{|test| test.attributes.keys }.inject(&:&)

        # check the provided headers are available
        unless headers.nil?
          not_available_headers = headers.select { |header| not common_attributes.include?(header) }
          raise "Some of headers provided aren't available in the JUnit report (#{not_available_headers})" unless not_available_headers.empty?
        end

        keys = headers || common_attributes
        attributes = keys.map(&:to_s).map(&:capitalize)

        # Create the headers
        message << attributes.join(' | ') + "|\n"
        message << attributes.map { |_| '---' }.join(' | ') + "|\n"

        # Map out the keys to the tests
        tests.each do |test|
          row_values = keys.map { |key| test.attributes[key] }.map { |v| auto_link(v) }
          message << row_values.join(' | ') + "|\n"
        end

        markdown message
      end
    end
Causes a build fail if there are test failures,
 and outputs a markdown table of the results.

 @return   [void]