mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-26 01:33:22 +00:00
Compile Webpacker assets only once in test environment
This commit is contained in:
@@ -71,15 +71,7 @@ development:
|
||||
watch_options:
|
||||
ignored: '**/node_modules/**'
|
||||
|
||||
|
||||
test:
|
||||
<<: *default
|
||||
compile: true
|
||||
|
||||
# Compile test packs to a separate directory
|
||||
public_output_path: packs-test
|
||||
|
||||
production:
|
||||
production: &production
|
||||
<<: *default
|
||||
|
||||
# Production depends on precompilation of packs prior to booting for performance.
|
||||
@@ -90,3 +82,9 @@ production:
|
||||
|
||||
# Cache manifest.json for performance
|
||||
cache_manifest: true
|
||||
|
||||
test:
|
||||
<<: *production
|
||||
|
||||
# Compile test packs to a separate directory
|
||||
public_output_path: packs-test
|
||||
|
||||
@@ -55,6 +55,12 @@ RSpec.configure do |config|
|
||||
Capybara.reset_sessions!
|
||||
end
|
||||
|
||||
# Precompile Webpacker assets (once) when starting the suite. The default setup can result
|
||||
# in the assets getting compiled many times throughout the build, slowing it down.
|
||||
config.before :suite do
|
||||
Webpacker.compile
|
||||
end
|
||||
|
||||
# Fix encoding issue in Rails 5.0; allows passing empty arrays or hashes as params.
|
||||
config.before(:each, type: :controller) { @request.env["CONTENT_TYPE"] = 'application/json' }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user