aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryuuji.yaginuma <yuuji.yaginuma@gmail.com>2019-02-10 10:40:05 +0900
committeryuuji.yaginuma <yuuji.yaginuma@gmail.com>2019-02-10 15:41:32 +0900
commit7942d675b8e63de154cfcd67cde2db5fcba880c7 (patch)
treeaad29e4c8620a95bb1558f16b035e62fb938d21e
parentea0eaced55465ce8054cf54ff583d75272bd8505 (diff)
downloadrails-7942d675b8e63de154cfcd67cde2db5fcba880c7.tar.gz
rails-7942d675b8e63de154cfcd67cde2db5fcba880c7.tar.bz2
rails-7942d675b8e63de154cfcd67cde2db5fcba880c7.zip
Avoid ajv@6.9.0 for now
Because ajv@6.9.0 does not work with webpack. Ref: https://github.com/epoberezkin/ajv/issues/941
-rw-r--r--railties/test/isolation/abstract_unit.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/railties/test/isolation/abstract_unit.rb b/railties/test/isolation/abstract_unit.rb
index ca7601f6fe..0ff4c03f4a 100644
--- a/railties/test/isolation/abstract_unit.rb
+++ b/railties/test/isolation/abstract_unit.rb
@@ -488,6 +488,22 @@ Module.new do
Dir.chdir(app_template_path) { `yarn add webpack@4.17.1 --tilde` }
Dir.chdir(app_template_path) { `yarn add webpack-cli` }
+ # FIXME: Temporary fix for webpack + ajv@6.9.0 compatible issue.
+ # See https://github.com/epoberezkin/ajv/issues/941
+ Dir.chdir(app_template_path) do
+ package = File.read("package.json")
+ resolutions = <<~EOS
+ ,
+ "resolutions": {
+ "ajv": "6.8.1"
+ }
+ }
+ EOS
+ if package =~ /\n}\n\z/
+ File.open("package.json", "w") { |f| f.puts $` + resolutions + $' }
+ end
+ end
+
# Fake 'Bundler.require' -- we run using the repo's Gemfile, not an
# app-specific one: we don't want to require every gem that lists.
contents = File.read("#{app_template_path}/config/application.rb")