Still can't figure out how to do unit testing with...
# golang
Still can't figure out how to do unit testing with remote component resources. This will panic. I've tried different things to mock the underlying bucket, which didn't work.
Copy code
package main

import (


type mocks int

// Create the mock.
func (mocks) NewResource(args pulumi.MockResourceArgs) (string, resource.PropertyMap, error) {
	outputs := args.Inputs.Mappable()
	if args.TypeToken == "awsx:cloudtrail:Trail" {
		//outputs["bucket"] = (&s3.Bucket{Bucket: pulumi.String("fake").ToStringOutput()}).ToBucketOutput()
		//outputs["bucket"] = &s3.Bucket{}
	return args.Name + "_id", resource.NewPropertyMapFromMap(outputs), nil

func (mocks) Call(args pulumi.MockCallArgs) (resource.PropertyMap, error) {
	outputs := map[string]interface{}{}
	return resource.NewPropertyMapFromMap(outputs), nil

func TestCloudTrail(t *testing.T) {
	err := pulumi.RunErr(func(ctx *pulumi.Context) error {
		trail, err := cloudtrail.NewTrail(ctx, "test-trail-go", &cloudtrail.TrailArgs{
			IncludeGlobalServiceEvents: pulumi.Bool(false),
			EnableLogging:              pulumi.Bool(true),
		assert.NoError(t, err)
		assert.NotNil(t, trail.Bucket.Bucket())

		return nil
	}, pulumi.WithMocks("project", "stack", mocks(0)))

	assert.NoError(t, err)
could you file a github issue for this?
Oh I thought I was doing something wrong.