This message was deleted.
s
This message was deleted.
e
https://stackoverflow.com/questions/76009185/how-to-mock-pulumi-resources-in-go-unit-tests might help You should just be able to override NewResource in the mocks to return data expected for your program.
f
I've tried! But in all those examples those parameters are simple types, but here it's ecs.TaskDefinition I've tried this in many variations:
Copy code
func (mocks) NewResource(args pulumi.MockResourceArgs) (string, resource.PropertyMap, error) {
> outputs := args.Inputs.Mappable()
> if args.TypeToken == "awsx:ecs:FargateTaskDefinition" {
> > outputs["taskDefinition"] = (&ecs.TaskDefinition{Arn: pulumi.String("fake").ToStringOutput()}).ToTaskDefinitionOutput()

> }
> outputs["arn"] = "arn:aws:ecs:ap-southeast-6:123451234512:fake-arn/fakeresource"
> return args.Name + "_id", resource.NewPropertyMapFromMap(outputs), nil
}
and other things constructing map of parameters, thinking it'll deserialise it into a proper object, which didn't work either