Hi! I just tried to use fresh 5.1 rails app with capybara and got error:
Failure/Error: = javascript_pack_tag 'application'
ActionView::Template::Error:
Can't find application.js in /****/public/packs/manifest-test.json. Is webpack still compiling?
...
...
# --- Caused by: ---
# Webpacker::FileLoader::NotFoundError:
# Can't find application.js in /***/public/packs/manifest-test.json. Is webpack still compiling?
# /***/bundler/gems/webpacker-56bd687798b6/lib/webpacker/manifest.rb:21:in `lookup'
webpack dev server is running.
It looks like rails cant find application.js in test environment, but how to find the solution for this problem?
Development env is working ok.
Any ideas?
RAILS_ENV=test ./bin/rails webpacker:compile
should be executed before running tests
@mfazekas Thank You! That helped. Do this command interfere with development server?
Nope it doesn't since it's scoped by environment and uses different manifest 馃憤
@gauravtiwari Thanks!
I wonder if it would be nicer if we had something that could be dropped into RSpec's rails_helper.rb
eg. require 'webpacker/rspec'
//edit just come across PR #360
Awesome
Most helpful comment
should be executed before running tests