mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-17 11:13:27 +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
@@ -11,6 +11,9 @@ func TestChan(t *testing.T) {
|
||||
|
||||
t.Parallel()
|
||||
|
||||
wasmTmpDir, server, cleanup := startServer(t)
|
||||
defer cleanup()
|
||||
|
||||
err := run("tinygo build -o " + wasmTmpDir + "/chan.wasm -target wasm testdata/chan.go")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -20,7 +23,7 @@ func TestChan(t *testing.T) {
|
||||
defer cancel()
|
||||
|
||||
err = chromedp.Run(ctx,
|
||||
chromedp.Navigate("http://localhost:8826/run?file=chan.wasm"),
|
||||
chromedp.Navigate(server.URL+"/run?file=chan.wasm"),
|
||||
waitLog(`1
|
||||
2
|
||||
4
|
||||
|
||||
Reference in New Issue
Block a user