diff --git a/ws_js_test.go b/ws_js_test.go
index e6be618157a7e66ce1364b2a444b8c30b8a9db17..ba98b9a0af39889bc513bb0c910859d5879c44ae 100644
--- a/ws_js_test.go
+++ b/ws_js_test.go
@@ -36,3 +36,19 @@ func TestWasm(t *testing.T) {
 	err = c.Close(websocket.StatusNormalClosure, "")
 	assert.Success(t, err)
 }
+
+func TestWasmDialTimeout(t *testing.T) {
+	t.Parallel()
+
+	ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond)
+	defer cancel()
+
+	beforeDial := time.Now()
+	_, _, err := websocket.Dial(ctx, "ws://example.com:9893", &websocket.DialOptions{
+		Subprotocols: []string{"echo"},
+	})
+	assert.Error(t, err)
+	if time.Since(beforeDial) >= time.Second {
+		t.Fatal("wasm context dial timeout is not working", time.Since(beforeDial))
+	}
+}