mirror of
https://github.com/BaaRai/ARTEX.git
synced 2026-11-19 06:30:54 +08:00
The stock seed was npx @playwright/mcp, but the UI mock and common invocations use npx -y, which the first pass left untouched. Also add --browser chromium to a leftover playwright-mcp --headless row, resolve the MCP's playwright-core CLI via require.resolve, and cover proxy-arg stripping so capture sync does not depend on args[0].
25 lines
649 B
Go
25 lines
649 B
Go
package server
|
|
|
|
import (
|
|
"slices"
|
|
"testing"
|
|
)
|
|
|
|
func TestStripProxyArgsLeavesBrowserMCPFlags(t *testing.T) {
|
|
in := []string{"--headless", "--browser", "chromium", "--proxy-server", "http://127.0.0.1:8788"}
|
|
got := stripProxyArgs(in)
|
|
want := []string{"--headless", "--browser", "chromium"}
|
|
if !slices.Equal(got, want) {
|
|
t.Fatalf("got %q, want %q", got, want)
|
|
}
|
|
if in[3] != "--proxy-server" {
|
|
t.Fatal("input mutated")
|
|
}
|
|
|
|
equals := []string{"--headless", "--proxy-server=http://127.0.0.1:8788", "--browser", "chromium"}
|
|
got = stripProxyArgs(equals)
|
|
if !slices.Equal(got, want) {
|
|
t.Fatalf("equals form: got %q, want %q", got, want)
|
|
}
|
|
}
|