<commit_before>ENV["RAILS_ENV"] = "test"
ENV["GOVUK_APP_DOMAIN"] = "test.gov.uk"

require File.expand_path("../config/environment", __dir__)

require "simplecov"
require "simplecov-rcov"

SimpleCov.start "rails" do
  formatter SimpleCov::Formatter::MultiFormatter.new([
    SimpleCov::Formatter::RcovFormatter,
    SimpleCov::Formatter::HTMLFormatter,
  ])

  add_group "Presenters", "app/presenters"
  add_group "Services", "app/services"
  add_group "Smart Answer", "lib/smart_answer"
  add_group "Smart Answer Flows", "lib/smart_answer_flows"
end

require "rails/test_help"

require "mocha/minitest"
Mocha.configure { |c| c.stubbing_non_existent_method = :prevent }

require "webmock/minitest"
WebMock.disable_net_connect!(allow_localhost: true)

module MinitestWithTeardownCustomisations
  def teardown
    super
    Timecop.return
    WorldLocation.reset_cache
  end
end
Minitest::Test.prepend MinitestWithTeardownCustomisations

require "gds_api/test_helpers/json_client_helper"<commit_msg>Add a minimum coverage level<commit_after>ENV["RAILS_ENV"] = "test"
ENV["GOVUK_APP_DOMAIN"] = "test.gov.uk"

require File.expand_path("../config/environment", __dir__)

require "simplecov"
require "simplecov-rcov"

SimpleCov.start "rails" do
  formatter SimpleCov::Formatter::MultiFormatter.new([
    SimpleCov::Formatter::RcovFormatter,
    SimpleCov::Formatter::HTMLFormatter,
  ])

  add_group "Presenters", "app/presenters"
  add_group "Services", "app/services"
  add_group "Smart Answer", "lib/smart_answer"
  add_group "Smart Answer Flows", "lib/smart_answer_flows"

  SimpleCov.minimum_coverage 92
end

require "rails/test_help"

require "mocha/minitest"
Mocha.configure { |c| c.stubbing_non_existent_method = :prevent }

require "webmock/minitest"
WebMock.disable_net_connect!(allow_localhost: true)

module MinitestWithTeardownCustomisations
  def teardown
    super
    Timecop.return
    WorldLocation.reset_cache
  end
end
Minitest::Test.prepend MinitestWithTeardownCustomisations

require "gds_api/test_helpers/json_client_helper"
{'fraction_non_alphanumeric': 0.10931372549019608, 'fraction_numerical': 0.000980392156862745, 'mean_word_length': 6.315412186379929, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1735395', 'n_tokens_mistral': 720, 'n_tokens_neox': 699, 'n_words': 123}