mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Removed some unecessary comments
This commit is contained in:
@@ -14,12 +14,6 @@ module BetterRailsSystemTests
|
||||
|
||||
Capybara.using_session(Capybara.last_used_session) { super }
|
||||
end
|
||||
|
||||
## Use relative path in screenshot message
|
||||
##def image_path
|
||||
## absolute_image_path.relative_path_from(Rails.root).to_s
|
||||
##end
|
||||
|
||||
end
|
||||
|
||||
RSpec.configure do |config|
|
||||
|
||||
@@ -22,44 +22,4 @@ RSpec.configure do |config|
|
||||
end
|
||||
end
|
||||
|
||||
=begin
|
||||
|
||||
# frozen_string_literal: true
|
||||
|
||||
# Precompile assets before running tests to avoid timeouts.
|
||||
# Do not precompile if webpack-dev-server is running (NOTE: MUST be launched with RAILS_ENV=test)
|
||||
RSpec.configure do |config|
|
||||
config.before(:suite) do
|
||||
examples = RSpec.world.filtered_examples.values.flatten
|
||||
has_no_system_tests = examples.none? { |example| example.metadata[:type] == :system }
|
||||
|
||||
if has_no_system_tests
|
||||
$stdout.puts "\n🚀️️ No system test selected. Skip assets compilation.\n"
|
||||
next
|
||||
end
|
||||
|
||||
if Webpacker.dev_server.running?
|
||||
$stdout.puts "\n⚙️ Webpack dev server is running! Skip assets compilation.\n"
|
||||
next
|
||||
else
|
||||
$stdout.puts "\n🐢 Precompiling assets.\n"
|
||||
original_stdout = $stdout.clone
|
||||
# Use test-prof now 'cause it couldn't be monkey-patched (e.g., by Timecop or similar)
|
||||
start = Time.current
|
||||
begin
|
||||
# Silence Webpacker output
|
||||
$stdout.reopen(File.new("/dev/null", "w"))
|
||||
# next 3 lines to compile webpacker before running our test suite
|
||||
require "rake"
|
||||
Rails.application.load_tasks
|
||||
Rake::Task["webpacker:compile"].execute
|
||||
ensure
|
||||
$stdout.reopen(original_stdout)
|
||||
$stdout.puts "Finished in #{(Time.current - start).round(2)} seconds"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
=end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user