late-midnight-6939
03/25/2025, 1:06 PMStackReferences
in Go? I found this issue and from my understanding this is supported in Node and TypeScript, but I did not find any examples or documentation for achieving the same in Go. Thanks!little-cartoon-10569
03/25/2025, 7:19 PMsetMocks()
, and even if they were, the utility code is not part of your units and needn't be tested.
Instead, re-organize your code so that all of those utility methods (most notably, anything to do with Pulumi config and Pulumi stack references) are lifted out to your top level program, outside of your tested units. Then pass the values into your (testable) units as parameters.
Even if the utility code did always work perfectly when unit testing (and it doesn't), these values are very much within the realm of things that you want to test. And you don't want to have to create a test stack and up it, just so your unit test run can get referenced values from the stack. Instead, you want to pass test values in to your unts as part of your unit tests.