client/tests/client_test.go

30 lines
407 B
Go
Raw Normal View History

2024-10-13 23:12:55 +08:00
package client_test
import (
"fmt"
"testing"
"apigo.cc/gojs"
"apigo.cc/gojs/client"
)
func TestClient(t *testing.T) {
gojs.ExportForDev()
testOK := false
client.Bind("setTestOK", func(testIsOK bool) {
testOK = testIsOK
})
r, err := gojs.RunFile("client.js")
if err != nil {
t.Fatal(err)
}
gojs.WaitAll()
if !testOK {
t.Fatal("test failed")
} else {
fmt.Println("test OK", r)
}
}