diff options
author | Elliott Sales de Andrade <[email protected]> | 2020-12-22 17:56:53 -0500 |
---|---|---|
committer | Ron Evans <[email protected]> | 2021-01-25 19:12:31 +0100 |
commit | f3bdebe2a6dd7175d322a58fd48f48cf1f962371 (patch) | |
tree | 6237d60afa5029de50dfebf73ec10ccd52403aa6 /tests/wasm/chan_test.go | |
parent | 5bae55d75506f57b65a66a2be2402ab90c2705d4 (diff) | |
download | tinygo-f3bdebe2a6dd7175d322a58fd48f48cf1f962371.tar.gz tinygo-f3bdebe2a6dd7175d322a58fd48f48cf1f962371.zip |
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.
Diffstat (limited to 'tests/wasm/chan_test.go')
-rw-r--r-- | tests/wasm/chan_test.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/wasm/chan_test.go b/tests/wasm/chan_test.go index 1cd08e664..2faf95bac 100644 --- a/tests/wasm/chan_test.go +++ b/tests/wasm/chan_test.go @@ -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 |