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
refactor(common): nuxt.config.js and dynamic server options (latest process.env) #4208
Conversation
@pi0 or maybe not? will check later, gtg now :) |
I think they are needed for start your application from command line. |
Tests failing so not so easy :) But not a good that it repeats |
@pimlie is our cli hero :D |
It seems to me this could be merged after changing the test. The failing test is a direct result of the expectation that ./utils.js set a default for host/port. If we want to improve that by moving it to nuxt.config.js like all other defaults then we just cant test for that here. -- edit -- if (argv.port) {
options.server.port = argv.port
} Then if no port is supplied on the commandline the same defaults as now are already set in nuxt.config.js and applied to the running config with defaultsDeep. |
@pimlie ha, you're totally right! I had a feeling about this too but couldn't look into it at the time. Will update. |
So I've stopped at trying to load a fresh version of NuxtConfig because we need to pick up fresh |
Back later! |
Why and where is the fresh config needed? Its a bit hard to follow your thought process with all the fix descriptions, but if you are trying to fix the failing test which checks These are all strict unit tests which (try) to only test one (class) method at the time (and only stuff from this package). As setting the host from env is now moved from this package to nuxt/common the |
Because we introduce new environment variables dynamically in a test. But I guess you're right, following this approach this test doesn't make sense anymore, as there's no real-world scenario where |
Ah ok, thanks. If we have that problem in nuxt/common then its probably easier to just call |
Codecov Report
@@ Coverage Diff @@
## dev #4208 +/- ##
========================================
- Coverage 89% 88.83% -0.17%
========================================
Files 39 42 +3
Lines 1691 1684 -7
Branches 443 436 -7
========================================
- Hits 1505 1496 -9
- Misses 159 161 +2
Partials 27 27
Continue to review full report at Codecov.
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Shouldn't be needed after #4207 (comment)