This commit is contained in:
2026-01-28 21:59:04 -05:00
parent dcd516d970
commit ffcb6f658b
10 changed files with 60 additions and 134 deletions

View File

@@ -1,30 +0,0 @@
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<string>", "definition should include Promise<string>")
}
// TOOD: Test Normal Function