-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto-compile assets when running with rspec
#2675
Comments
Hey @mockdeep ! Indeed those two should run similarly. Is my understanding correct precompiling assets are only needed for feature and system specs? |
@pirj I'm not sure, but we might need it in controller tests as well in order to properly render the include tags in the html. I'm not familiar with how sprockets or webpacker handle it, but they seem to work out of the box. In my very limited experience with esbuild, it is orders of magnitude faster. From a clean slate it takes less than a second to compile a 1.5mb JS package. |
Right, I can't recall any similar issues with sprockets. |
|
See this line for the exact condition. This comment summarizes the behavior and the idea behind it. Currently calling I looked into fixing this in RSpec probably also has some more edge-cases than minitest, e.g. when running |
If its a case of calling the right rake task, then the command is |
As I wrote here, executing |
Do you have a simple repo with a reproduction for your behavior? I've not seen such a behavior before, but would be interested. |
I hit this problem with a new project. Here it is. If you run
|
Is your feature request related to a problem? Please describe.
When using
jsbundling-rails
, assets are not precompiled automatically when running tests via therspec
command line:But they are when run via the rake task:
Describe the solution you'd like
I would love it if behavior across these was consistent. I prefer to use the
rspec
command since it allows me to easily pass options torspec
, such as--fail-fast
or specific filters.Describe alternatives you've considered
For now we're considering adding
yarn build
to ourrails_helper.rb
so that it builds at the beginning of each test run.The text was updated successfully, but these errors were encountered: