limited-rainbow-51650
04/20/2020, 9:04 PMpulumi.ComponentResource
. In the constructor of this component, I create a gcp.compute.Network
. When unit testing, in the setMocks
function, as in the examples, I do a switch(type)
and I only left the default
clause in there with a console.log
statement. When running the tests, I create an instance of my component. I expect the newResource
callback to be invoked twice but I only see it for my component, not for the inner gcp.compute.Network
. Are my expectations wrong?tall-librarian-49374
04/20/2020, 9:28 PMlimited-rainbow-51650
04/20/2020, 9:30 PMpulumi.runtime.setMocks({
newResource: function(type: string, name: string, inputs: any): {id: string, state: any} {
console.log(`newResource(${type}, ${name}, ${util.inspect(inputs)})`)
switch (type) {
...
I moved the log statement to the beginning of newResource
and it is called only once:
newResource(cumundi:network/gcp:Network, production, {})
tall-librarian-49374
04/20/2020, 9:52 PM