clean up
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user