sparse-intern-71089
06/25/2021, 4:41 PMbreezy-cricket-40277
06/25/2021, 4:46 PMjest but same happens with mocha so it’s not the testing framework.breezy-cricket-40277
06/25/2021, 4:47 PMpulumi is requiring my configuration values..breezy-cricket-40277
06/25/2021, 4:48 PMbreezy-cricket-40277
06/25/2021, 4:51 PMconfig.require('somevalue') in some places of my code. to inject configuration from the .yaml files, however I don’t want this behavior in unit testing. But even initializing the setMocks function with the project and stack arguments, it doesn’t get the values from the yaml files. 😕brave-planet-10645
06/25/2021, 4:53 PMbreezy-cricket-40277
06/25/2021, 4:54 PMfaint-table-42725
06/25/2021, 5:11 PMhundreds-restaurant-18469
06/25/2021, 5:38 PMconfig values to the test, or read the yaml config into json and export it as a variable? 😕faint-table-42725
06/25/2021, 5:52 PMbreezy-cricket-40277
06/25/2021, 6:05 PMbreezy-cricket-40277
06/25/2021, 6:34 PMindex.ts a single constant, like my resourceGroup for azure, but this code actually makes it so I cannot do it:
let infra: typeof import('../index');
beforeAll(async function () {
infra = await import('../index');
});
If I try to adapt it slightly to just take the exported constant it doesn’t work. 😕
Also when I’m trying to import nested config objects I get this error:
Configuration 'project:services' value '[object Object]' is not a valid JSON object
Example of this services object:
project:services:
myapp1Version: 23
myapp2Version: 24
JSON string:
{
"project:baseDomain": "mydomain.dev",
"project:services": {
"myapp1Version": 23,
"myapp2Version": 24
}
}
Isn’t there a better way to inject configuration? Some pulumi.runtime method or something?