To mock `Pulumi.Config`it must be done via `PULUMI...
# general
p
To mock `Pulumi.Config`it must be done via
PULUMI_CONFIG
environment variable for example I have the following utility method I use for my unit tests
Copy code
public static void WithConfig(Dictionary<string, object> config)
    {
        var values = System.Text.Json.JsonSerializer.Serialize(config, new System.Text.Json.JsonSerializerOptions()
        {
        });

        Environment.SetEnvironmentVariable("PULUMI_CONFIG", values);
    }
Which I can then use in my test like so
Copy code
WithConfig(new Dictionary<string, object>()
{
    { "key:value", "test-value" },
});
👍 1