forked from NVIDIA/NemoClaw
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtunnel-command.test.ts
More file actions
85 lines (73 loc) · 3.09 KB
/
Copy pathtunnel-command.test.ts
File metadata and controls
85 lines (73 loc) · 3.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
import { describe, expect, it } from "vitest";
import { run } from "./helpers";
describe("tunnel CLI dispatch", () => {
it("tunnel --help exits 0 and shows tunnel subcommands", () => {
const r = run("tunnel --help");
expect(r.code).toBe(0);
expect(r.out).toContain("tunnel <start|stop|status>");
expect(r.out).toContain("tunnel start");
expect(r.out).toContain("tunnel stop");
expect(r.out).toContain("tunnel status");
});
it("root help shows tunnel status with tunnel start and stop", () => {
const r = run("--help");
expect(r.code).toBe(0);
expect(r.out).toContain("nemoclaw tunnel start");
expect(r.out).toContain("nemoclaw tunnel stop");
expect(r.out).toContain("nemoclaw tunnel status");
});
it("tunnel start --help exits 0 and shows tunnel usage", () => {
const r = run("tunnel start --help");
expect(r.code).toBe(0);
expect(r.out).toContain("tunnel start");
expect(r.out).toContain("Start the cloudflared public-URL tunnel");
});
it("deprecated start --help exits 0 and describes migration-only behavior", () => {
const r = run("start --help");
expect(r.code).toBe(0);
expect(r.out).toContain("this command does not");
expect(r.out).toContain("start a sandbox or public-URL tunnel");
expect(r.out).toContain("nemoclaw <name> start");
expect(r.out).toContain("nemoclaw tunnel start");
});
it("deprecated start exits 0 with sandbox-scoped migration guidance (#9303)", () => {
const r = run("start 2>&1");
expect(r.code).toBe(0);
expect(r.out).toContain("nemoclaw <name> start");
expect(r.out).toContain("nemoclaw tunnel start");
});
it("tunnel stop --help exits 0 and shows tunnel usage", () => {
const r = run("tunnel stop --help");
expect(r.code).toBe(0);
expect(r.out).toContain("tunnel stop");
expect(r.out).toContain("Stop the cloudflared public-URL tunnel");
});
it("tunnel status --help exits 0 and shows tunnel status usage", () => {
const r = run("tunnel status --help");
expect(r.code).toBe(0);
expect(r.out).toContain("tunnel status");
expect(r.out).toContain("Show cloudflared public-URL tunnel status");
});
it("tunnel status exits 0 and prints cloudflared status", () => {
const r = run("tunnel status");
expect(r.code).toBe(0);
expect(r.out).toContain("cloudflared");
});
it("bare tunnel exits 0 and shows tunnel subcommands", () => {
const r = run("tunnel");
expect(r.code).toBe(0);
expect(r.out).toContain("tunnel <start|stop|status>");
expect(r.out).toContain("tunnel start");
expect(r.out).toContain("tunnel stop");
expect(r.out).toContain("tunnel status");
});
it("deprecated stop --help exits 0 and explains legacy full-stop behavior", () => {
const r = run("stop --help");
expect(r.code).toBe(0);
expect(r.out).toContain("stop");
expect(r.out).toContain("Deprecated full stop");
expect(r.out).toContain("releases the managed host gateway port");
});
});