-
Notifications
You must be signed in to change notification settings - Fork 342
Unit tests fail because webpack-stats.json don't exists #187
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
Comments
I'm in the same boat as you, and I've found a 'fix' where I just make sure to run |
@jwerardi My work around was creating an empty {"status":"done","publicPath":"https://127.0.0.1:4200/static/bundles/","chunks": {"main": []}} |
@srtab Would you mind sharing how you did to change the |
@macecchi I have specific settings for tests that are only loaded when running my tests. Example of import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
PROJECT_DIR = os.path.abspath(os.path.join(BASE_DIR, '..'))
WEBPACK_LOADER = {
'DEFAULT': {
'STATS_FILE': os.path.join(PROJECT_DIR, 'static', 'webpack-stats-test.json')
}
}
... |
Thanks @srtab! I was trying with override_settings but with no success. I'll try setting up a new file :) |
Thanks @srtab, went through the same issue, glad I've found your workaround! I think it would be useful to have this in the README. |
For others that may have a lot of different entry points in webpack which change frequently and just want their tests to not blowup when encountering the
|
Creating a fake stat file for the tests didn't work for me, the default
I created a Would it make sense to include such a loader as part of this library to help users with testing? |
Thanks for the report @browniebroke. Yes, please feel free to open a PR! |
Hi,
I'm having problems running unit tests because
webpack-stats.json
don't exists in my CI, the file is not under version control along with the code. Do i need to add it? Is there a Test mode to avoid adding this file under VCS?The feature requested in #137 could be a good solution, this makes possible creating a specific loader for testing purpose.
Tks,
Sandro Rodrigues
The text was updated successfully, but these errors were encountered: