我正在使用Rails 5.1.1,并且对于我们的rspec特性测试,我们希望在运行所有特性测试之前使用预编译的资源。(主要原因是因为capybara-webkit不支持JavaScript es6功能)
使用RAILS_ENV=test rake assets:precompile
成功预编译资源,但是capybara-webkit似乎没有使用预编译的资源。
config/environment/test.rb的内容如下:
config.assets.prefix = "/assets_test"
config.assets.compile = true
config.serve_static_assets = true
config.assets.js_compressor = Uglifier.new(
harmony: true #es6 support
)
我需要添加什么内容才能让测试使用预编译的资源?
harmony
选项(因为已经没有 ES6 代码需要最小化)。 - Thomas Walpole