testBrowserCommandsKeepTheUrlWhole

tcmts.atproto.test.testBrowserCommandsKeepTheUrlWhole · #64jihjht · term

Windows' cmd gets a URL with & in it whole; another's is passed as it is.

import { browserCommand } from "#codebase/tcmts/atproto";
import assert from "node:assert/strict";

export const testBrowserCommandsKeepTheUrlWhole = () => {
  assert.deepEqual(browserCommand("https://a.example/x?a=1&b=2", "win32", undefined), [
    "cmd",
    ["/c", "start", "", "https://a.example/x?a=1^&b=2"],
  ]);
  assert.deepEqual(browserCommand("https://a.example/?a=1&b=2", "darwin", undefined), [
    "open",
    ["https://a.example/?a=1&b=2"],
  ]);
}

uses