import { describe, expect, it } from "vitest" ;
import { parseSshTarget } from "./ssh-tunnel.js" ;
describe("parseSshTarget" , () => {
it("parses user@host:port targets" , () => {
expect(parseSshTarget("me@example.com:2222" )).toEqual({
user: "me" ,
host: "example.com" ,
port: 2222 ,
});
});
it("strips an ssh prefix and keeps the default port when missing" , () => {
expect(parseSshTarget(" ssh alice@example.com " )).toEqual({
user: "alice" ,
host: "example.com" ,
port: 22 ,
});
});
it("rejects invalid hosts and ports" , () => {
expect(parseSshTarget("" )).toBeNull();
expect(parseSshTarget("me@example.com:0" )).toBeNull();
expect(parseSshTarget("me@example.com:not-a-port" )).toBeNull();
expect(parseSshTarget("-V" )).toBeNull();
expect(parseSshTarget("me@-badhost" )).toBeNull();
expect(parseSshTarget("-oProxyCommand=echo" )).toBeNull();
});
});
Messung V0.5 in Prozent C=100 H=100 G=100
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.12Angebot
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-06-10)
¤
*Eine klare Vorstellung vom Zielzustand