-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
🐛 fix build-constant isForTesting #35335
Conversation
@@ -18,7 +18,7 @@ const {VERSION} = require('./internal-version'); | |||
|
|||
const testTasks = ['e2e', 'integration', 'visual-diff', 'unit', 'check-types']; | |||
const isTestTask = testTasks.some((task) => argv._.includes(task)); | |||
const isForTesting = argv.fortesting || isTestTask; | |||
const isForTesting = argv.fortesting || !argv._.includes('dist'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm out of my depth here but will this set getMode().localDev
to true
or getMode().test
to true
or both?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will allow getMode().localDev
to be true. Without fortesting==true
, the check early exits.
The naming of the variables is really not helping here.
I think if we flipped the conditions and renamed the variable to IS_FOR_PRODUCTION
it would make much more sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seeing if it makes it more clear here: #35336
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I think the renaming helps. Thanks Jake.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for looking into this so quickly!
summary
Fixes #35325
I created a bug in local development when merging #34327.
I had assumed
isForTesting
corresponded to when the flag--fortesting
was passed, but really the value should always be true unlessamp dist
is used without the fortesting flag.cc @calebcordry