Check for asset compilation before each spec file

The KnapsackPro queue mode can't predict which specs it will run. So we
need to check on each file (top-level describe block) which type of spec
it is and if we need to compile assets for it.

Old versions of KnapsackPro would execute the `before(:suite)` hooks on
every batch, but now it's only run once. With this change, we do the
same as before.
This commit is contained in:
Maikel Linke
2024-05-08 13:15:14 +10:00
parent 104357d5b9
commit 5f07a7f390

View File

@@ -1,7 +1,7 @@
# frozen_string_literal: true
RSpec.configure do |config|
config.before(:suite) do
config.before(:all) do
# We can use webpack-dev-server for tests, too!
# Useful if you working on a frontend code fixes and want to verify them via system tests.
next if Webpacker.dev_server.running?