You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I run npm run test, I see the following warning:
DefinePlugin
Conflicting values for 'process.env.NODE_ENV'
[
{
message: "DefinePlugin\nConflicting values for 'process.env.NODE_ENV'",
details: `'"test"' !== '"development"'`,
stack: '...'
}
]
We set NODE_ENV to test based on the Vue CLI docs:
With NODE_ENV set to "test" for example, Vue CLI creates a webpack config that is intended to be used and optimized for unit tests.
When I add some debugging to karma.conf.js, I can see that the mode property of the webpack config object is 'development'. If I try to set it to 'test', I see an error:
04 12 2022 18:19:43.258:ERROR [karma-server]: Error during file loading or preprocessing
ValidationError: Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
- configuration.mode should be one of these:
"development" | "production" | "none"
-> Enable production optimizations or development hints.
If I change NODE_ENV to production or development, I see that the resulting webpack config is different from when NODE_ENV is test.
There are differences between what we do in production vs. development vs. testing, in large part based on NODE_ENV. For example, we have more logging in development, while in testing, we expose access to local requestData resources.
I did a quick search of Vue CLI GitHub issues and didn't see anything related. I don't think we necessarily need to investigate this further, since tests seem to be working, and we'll be moving from Vue CLI as part of #671. But I wanted to file an issue with what I've learned so far.
The text was updated successfully, but these errors were encountered:
When I run
npm run test
, I see the following warning:We set
NODE_ENV
totest
based on the Vue CLI docs:When I add some debugging to karma.conf.js, I can see that the
mode
property of the webpack config object is'development'
. If I try to set it to'test'
, I see an error:If I change
NODE_ENV
toproduction
ordevelopment
, I see that the resulting webpack config is different from whenNODE_ENV
istest
.There are differences between what we do in production vs. development vs. testing, in large part based on
NODE_ENV
. For example, we have more logging in development, while in testing, we expose access to localrequestData
resources.I did a quick search of Vue CLI GitHub issues and didn't see anything related. I don't think we necessarily need to investigate this further, since tests seem to be working, and we'll be moving from Vue CLI as part of #671. But I wanted to file an issue with what I've learned so far.
The text was updated successfully, but these errors were encountered: