Relative Content

Tag Archive for node.jstypescriptenvironment-variablesnestjs

How to disable overriding of env variables in Nest.js Config Module

Im using @nestjs/config alongside env-var for managing my configuration in Nest.js. However, when I specify env variables in [load] function for ConfigModule with the same names as environment:
CLICKHOUSE_HOST: get('CLICKHOUSE_HOST').required().asString() it gets overriden by the actual variable, so I cant neither stub ConfigModule for tests nor use any values other than strings, so workaround is to use other names:
messenger_enabled: get('MESSENGER_ENABLED').default('false').asBool(). I wonder, is there any way to disable the overriding? ignoreEnvFile and ignoreEnvVars options doesn’t help in configuration