-
Notifications
You must be signed in to change notification settings - Fork 66
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
testDefault? #32
Comments
Interesting. Currently I manually pass args when calling |
I've written a function testOnly (testDefault) {
return process.env.NODE_ENV === 'test'
? testDefault
: undefined
} Which lets me do: APP_COGNITO_CLIENT_ID: validators.cognitoUserPoolClientId({devDefault: testOnly('stub+client+id')}), Which is an OK workaround, but having a |
I like your workaround, and can't really think of a better one to be honest. The issue I see with adding Maybe we could add your |
Fair enough. You mean |
Yep, that's exactly what I'm thinking |
Cool, will keep this issue in mind. Have some other projects also hoping for my attention 😄 If anybody else wants to pick this up, feel free! |
How to use different values for test and for production? |
Fixes af#32
I'm using envalid in a server setup which needs to interact with AWS resources. I have a use case where a variable is required during development, but not during testing. I could set
devDefault
but that'll just lead to runtime errors. It'd be great if envalid could support atestDefault
which only applies whenNODE_ENV === 'test'
.The text was updated successfully, but these errors were encountered: