mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-16 02:33:28 +00:00
Use httptest to serve wasm test files.
This picks a port automatically, so avoids any conflicts that might arise from running the tests in parallel.
This commit is contained in:
committed by
Ron Evans
parent
5bae55d755
commit
f3bdebe2a6
@@ -13,6 +13,9 @@ func TestEvent(t *testing.T) {
|
||||
|
||||
t.Parallel()
|
||||
|
||||
wasmTmpDir, server, cleanup := startServer(t)
|
||||
defer cleanup()
|
||||
|
||||
err := run("tinygo build -o " + wasmTmpDir + "/event.wasm -target wasm testdata/event.go")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -23,7 +26,7 @@ func TestEvent(t *testing.T) {
|
||||
|
||||
var log1, log2 string
|
||||
err = chromedp.Run(ctx,
|
||||
chromedp.Navigate("http://localhost:8826/run?file=event.wasm"),
|
||||
chromedp.Navigate(server.URL+"/run?file=event.wasm"),
|
||||
chromedp.WaitVisible("#log"),
|
||||
chromedp.Sleep(time.Second),
|
||||
chromedp.InnerHTML("#log", &log1),
|
||||
|
||||
Reference in New Issue
Block a user