package functions import ( "context" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) type TestArgs struct { Field1 string `json:"field1"` } func (t TestArgs) Validate() error { return nil } func TestAsyncFunction(t *testing.T) { RegisterAsyncFunction("testAsync", func(_ context.Context, args TestArgs) (string, error) { return "result: " + args.Field1, nil }) fn, ok := functionRegistry["testAsync"] require.True(t, ok, "testAsync should be registered") assert.Contains(t, fn.Definition(), "Promise", "definition should include Promise") } // TOOD: Test Normal Function