tinygo/tests/wasm/chan_test.go
Ayke van Laethem 59d53182bb all: use new testing features of Go 1.14 and 1.15
This simplifies the tests a bit.
2021-08-16 21:19:26 +02:00

36 строки
497 Б
Go

package wasm
import (
"testing"
"time"
"github.com/chromedp/chromedp"
)
func TestChan(t *testing.T) {
t.Parallel()
wasmTmpDir, server := startServer(t)
err := run("tinygo build -o " + wasmTmpDir + "/chan.wasm -target wasm testdata/chan.go")
if err != nil {
t.Fatal(err)
}
ctx, cancel := chromectx(5 * time.Second)
defer cancel()
err = chromedp.Run(ctx,
chromedp.Navigate(server.URL+"/run?file=chan.wasm"),
waitLog(`1
2
4
3
true`),
)
if err != nil {
t.Fatal(err)
}
}