wasm test suite (#1116)

* wasm: add test suite using headlless chrome
This commit is contained in:
Brad Peabody
2020-05-23 05:12:01 -07:00
committed by GitHub
parent dda576e80b
commit 95f509b109
13 changed files with 447 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
package wasm
import (
"testing"
"time"
"github.com/chromedp/chromedp"
)
func TestChan(t *testing.T) {
t.Parallel()
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("http://localhost:8826/run?file=chan.wasm"),
waitLog(`1
2
4
3
true`),
)
if err != nil {
t.Fatal(err)
}
}