如果我用bin/rails test
运行测试,它会触发YAR运行两次,一次是针对esbuild,一次是针对css.如果我对bin/rails test test/**/**.rb
或bin/rails test test/
运行所有相同的测试,测试会立即运行.
为什么在我不运行系统测试时会发生这种情况?)
Versions: Rails 7.1.1, Ruby 3.2.2, Minitest 5.20.0
App created with rails new my_app --javascript esbuild --css bootstrap
另外一个问题--我下次怎么自己解决这个问题呢?
我的测试助手似乎没有调用rails test:prepare
或其他触发yarn的东西:
# test/test_helper.rb
ENV["RAILS_ENV"] ||= "test"
require_relative "../config/environment"
require "rails/test_help"
module ActiveSupport
class TestCase
# Run tests in parallel with specified workers
parallelize(workers: :number_of_processors)
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
fixtures :all
# Add more helper methods to be used by all tests here...
end
end
我试着浏览了test_helper.rb
中的每个require
d文件,但在其他任何地方都找不到任何被告知要进行Yarn /assets资源 /预编译的地方:
-
../config/environment
❌-
config/application
❌-
config/boot
° - 第
rails/all
章(不知道从哪里开始)
-
-
-
rails/test_help
❓ (read through source but only looked in to one of the things it requires)-
active_support/testing/autorun
麸质(source)
-
我也try 了bundle open minitest
,希望在那里配置一些东西,但我四处摸索了一下,没有看到任何相关的东西.
在哪里配置了用于测试的Yarn /assets资源 编译"魔术"?