[Bug][cli] --load-env-files
cannot be used in conjunction with yarn rw test
#11884
Labels
bug/needs-info
More information is needed for reproduction
What's not working?
#9961 introduced a flag into the CLI to load additional
.env
files which is currently named--load-env-files
:redwood/packages/cli/src/index.js
Lines 180 to 188 in 5e1ba7e
Trying to use this feature for testing fails (Outcome 1):
This is presumably because everything after the first input following
test
is forwarded to jest.redwood/packages/cli/src/commands/testHandler.js
Lines 72 to 79 in 5e1ba7e
However the same outcome happens for
yarn rw test --load-env-files test
.As far as i understand it, the option assumes all space-separated input to be
.env.*
-files to load until the next option, which is why the following doesn't work either (Outcome 2):Current known workarounds
(set -a && source .env.test && set +a && yarn rw test api)
(export $(cat .env.test | xargs) && yarn rw test api)
(will fail if.env.test
contains# comments
)What's your environment? (If it applies)
Are you interested in working on this?
The text was updated successfully, but these errors were encountered: