Skip to content

Commit 8feddd6

Browse files
test(packages): prune low-value tests in packages (second pass) (pingdotgg#22593)
Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent a2f4df0 commit 8feddd6

105 files changed

Lines changed: 190 additions & 2840 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎packages/client-runtime/src/connection/presentation.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ describe("connection presentation", () => {
8686
expect(environmentMcpUrl({ entry })).toBe("http://192.168.4.53:3773/mcp");
8787
});
8888

89+
// regression: #16909 Copy MCP URL falls back to an alternate route when the relay route has no address
8990
it("passes over routes without an address of their own", () => {
9091
const relay = new RelayConnectionTarget({
9192
environmentId: TARGET.environmentId,

‎packages/client-runtime/src/device/duoControl.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ it("pinches only a hit device, accumulates independently of native readback, cla
8585
expect(pinch.active).toBe(false);
8686
});
8787

88+
// regression: #16630 fold controls follow the phone's orientation on each screen
8889
it.each([
8990
[
9091
"vertical phone, closed",

‎packages/client-runtime/src/errors/transport.test.ts‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ import { NETWORK_BLOCKING_HINT } from "./network.ts";
44
import { isTransportConnectionErrorMessage, sanitizeThreadErrorMessage } from "./transport.ts";
55

66
describe("isTransportConnectionErrorMessage", () => {
7-
it("returns true for SocketCloseError", () => {
8-
expect(isTransportConnectionErrorMessage("SocketCloseError: connection reset")).toBe(true);
9-
});
10-
117
it("returns true for React Native disconnected socket errors", () => {
128
expect(
139
isTransportConnectionErrorMessage(

‎packages/client-runtime/src/markdownImages.test.ts‎

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,12 @@ import { classifyMarkdownImageSource } from "./markdownImages.js";
55
describe("classifyMarkdownImageSource", () => {
66
it.each([
77
["images/result.png", "/workspace/project", "/workspace/project/images/result.png"],
8-
["./images/result.png", "/workspace/project", "/workspace/project/./images/result.png"],
9-
[
10-
"images/result.png",
11-
"C:\\Users\\dara\\project",
12-
"C:\\Users\\dara\\project\\images\\result.png",
13-
],
148
[
159
"images\\result.png",
1610
"C:\\Users\\dara\\project",
1711
"C:\\Users\\dara\\project\\images\\result.png",
1812
],
19-
["/workspace/project/image.png", null, "/workspace/project/image.png"],
20-
["/C:/Users/dara/project/image.png", null, "C:/Users/dara/project/image.png"],
21-
["C:/Users/dara/project/image.png", null, "C:/Users/dara/project/image.png"],
22-
["\\\\server\\share\\image.png", null, "\\\\server\\share\\image.png"],
2313
["file:///workspace/project/image%20one.png", null, "/workspace/project/image one.png"],
24-
["file:///C:/Users/dara/project/image.png", null, "C:/Users/dara/project/image.png"],
25-
["file://localhost/C:/Users/dara/project/image.png", null, "C:/Users/dara/project/image.png"],
2614
["file://server/share/image.png", null, "\\\\server\\share\\image.png"],
2715
])("maps %s to a workspace file", (source, workspaceRoot, path) => {
2816
expect(classifyMarkdownImageSource(source, workspaceRoot)).toEqual({
@@ -31,19 +19,10 @@ describe("classifyMarkdownImageSource", () => {
3119
});
3220
});
3321

34-
it.each([
35-
null,
36-
"",
37-
"#image",
38-
"?image=1",
39-
"image.png",
40-
"~/image.png",
41-
"javascript:alert(1)",
42-
"ftp://example.com/image.png",
43-
"content://media/image/1",
44-
"custom:image.png",
45-
"file://%",
46-
])("blocks unsupported or unresolved source %s", (source) => {
47-
expect(classifyMarkdownImageSource(source)).toEqual({ _tag: "Blocked" });
48-
});
22+
it.each(["image.png", "javascript:alert(1)", "file://%"])(
23+
"blocks unsupported or unresolved source %s",
24+
(source) => {
25+
expect(classifyMarkdownImageSource(source)).toEqual({ _tag: "Blocked" });
26+
},
27+
);
4928
});

‎packages/client-runtime/src/mediaReference.test.ts‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,9 @@ import { mediaFileReference, mediaReferenceFileName } from "./mediaReference.ts"
55
describe("mediaFileReference", () => {
66
it.each([
77
["/work/project/./media/../clip.mp4", "/work/project/", "clip.mp4"],
8-
["/work/project/../outside.mp4", "/work/project", undefined],
98
["/work/project-other/clip.mp4", "/work/project", undefined],
10-
["/work/Project/clip.mp4", "/work/project", undefined],
11-
["/work/project/a\\b.mp4", "/work/project", "a\\b.mp4"],
12-
["/work/clip.mp4", "/work/other/..", "clip.mp4"],
13-
["/clip.mp4", "/", "clip.mp4"],
149
["C:\\WORK\\project\\media\\..\\Clip.mp4", "c:/work/project/", "Clip.mp4"],
15-
["D:\\work\\clip.mp4", "C:\\work", undefined],
1610
["\\\\Server\\Share\\Project\\Clip.mp4", "//server/share/project", "Clip.mp4"],
17-
["\\\\server\\other\\clip.mp4", "\\\\server\\share", undefined],
18-
["../clip.mp4", "/work/project", undefined],
1911
])("preserves %s and only labels paths inside %s as relative", (path, root, relativePath) => {
2012
expect(mediaFileReference(path, root)).toEqual({
2113
kind: "file",
@@ -28,10 +20,7 @@ describe("mediaFileReference", () => {
2820
describe("mediaReferenceFileName", () => {
2921
it.each([
3022
[{ kind: "file", path: "/tmp/take\\one%20.mp4" }, "take\\one%20.mp4"],
31-
[{ kind: "file", path: "C:\\clips/take\\one.mp4" }, "one.mp4"],
32-
[{ kind: "file", path: "\\\\server\\share\\one.mp4" }, "one.mp4"],
3323
[{ kind: "url", url: "//cdn.example/clip%20one%2Emp4?sig=a+b#t=2" }, "clip one.mp4"],
34-
[{ kind: "url", url: "https://cdn.example/clip%2520.mp4" }, "clip%20.mp4"],
3524
[{ kind: "url", url: "https://cdn.example/clip%20%oops.mp4" }, "clip%20%oops.mp4"],
3625
] as const)("preserves filename semantics for %j", (reference, name) => {
3726
expect(mediaReferenceFileName(reference)).toBe(name);

‎packages/client-runtime/src/mediaSource.test.ts‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,8 @@ describe("resolveMediaSource", () => {
3434
describe("host paths", () => {
3535
it.each([
3636
["/tmp/frame%23one.png:12", "/tmp/frame#one.png"],
37-
["/tmp/frame%3Fone.png:12:3", "/tmp/frame?one.png"],
3837
["/tmp/frame%2523one.png:12", "/tmp/frame%23one.png"],
39-
["C:\\Users\\demo\\frame.png", "C:\\Users\\demo\\frame.png"],
40-
["/C:/Users/demo/frame.png", "C:/Users/demo/frame.png"],
41-
["file:///C:/Users/demo/frame.png", "C:/Users/demo/frame.png"],
4238
["file://server/share/frame.png", "\\\\server\\share\\frame.png"],
43-
["\\\\server\\share\\frame.png", "\\\\server\\share\\frame.png"],
4439
])("resolves %s through the environment", (href, path) => {
4540
expect(resolveMediaSource(href, { threadId, workspaceRoot: "/repo" })).toEqual({
4641
kind: "image",

‎packages/client-runtime/src/operations/commands.test.ts‎

Lines changed: 69 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -395,80 +395,75 @@ describe("V2 environment commands", () => {
395395
}).pipe(Effect.provide(layerTestCrypto)),
396396
);
397397

398-
it.effect.each([
399-
"waiting",
400-
"completed",
401-
"failed",
402-
"interrupted",
403-
"cancelled",
404-
"rolled_back",
405-
] as const)("dispatches Stop for %s runs with background commands except rollback", (status) =>
406-
Effect.gen(function* () {
407-
const waitingRunId = RunId.make("run-waiting");
408-
const projection: OrchestrationV2ThreadProjection = {
409-
...v2Projection,
410-
runs: [
411-
{
412-
id: waitingRunId,
413-
threadId: v2ThreadId,
414-
ordinal: 1,
415-
providerInstanceId: v2Projection.thread.providerInstanceId,
416-
modelSelection: v2Projection.thread.modelSelection,
417-
providerThreadId: null,
418-
userMessageId: MessageId.make("message-waiting"),
419-
rootNodeId: null,
420-
activeAttemptId: null,
421-
status,
422-
requestedAt: v2Now,
423-
startedAt: v2Now,
424-
completedAt: null,
425-
checkpointId: null,
426-
contextHandoffId: null,
427-
},
428-
],
429-
turnItems: [
430-
{
431-
id: TurnItemId.make("background-command"),
432-
threadId: v2ThreadId,
433-
runId: waitingRunId,
434-
nodeId: null,
435-
providerThreadId: null,
436-
providerTurnId: null,
437-
nativeItemRef: null,
438-
parentItemId: null,
439-
ordinal: 1,
440-
status: "running",
441-
title: null,
442-
startedAt: v2Now,
443-
completedAt: null,
444-
updatedAt: v2Now,
445-
type: "command_execution",
446-
input: "vp run dev",
447-
},
448-
],
449-
};
450-
const commands: OrchestrationV2Command[] = [];
451-
const supervisor = yield* makeSupervisor({ commands, projects: [], projection });
452-
453-
const result = yield* interruptThreadTurn({ threadId: v2ThreadId }).pipe(
454-
Effect.provideService(EnvironmentSupervisor.EnvironmentSupervisor, supervisor),
455-
);
456-
457-
expect(result).toEqual({ sequence: status === "rolled_back" ? 0 : 1 });
458-
expect(commands).toEqual(
459-
status === "rolled_back"
460-
? []
461-
: [
462-
{
463-
type: "run.interrupt",
464-
commandId: expect.any(String),
465-
threadId: v2ThreadId,
466-
runId: waitingRunId,
467-
holdQueue: true,
468-
},
469-
],
470-
);
471-
}).pipe(Effect.provide(layerTestCrypto)),
398+
it.effect.each(["waiting", "completed", "rolled_back"] as const)(
399+
"dispatches Stop for %s runs with background commands except rollback",
400+
(status) =>
401+
Effect.gen(function* () {
402+
const waitingRunId = RunId.make("run-waiting");
403+
const projection: OrchestrationV2ThreadProjection = {
404+
...v2Projection,
405+
runs: [
406+
{
407+
id: waitingRunId,
408+
threadId: v2ThreadId,
409+
ordinal: 1,
410+
providerInstanceId: v2Projection.thread.providerInstanceId,
411+
modelSelection: v2Projection.thread.modelSelection,
412+
providerThreadId: null,
413+
userMessageId: MessageId.make("message-waiting"),
414+
rootNodeId: null,
415+
activeAttemptId: null,
416+
status,
417+
requestedAt: v2Now,
418+
startedAt: v2Now,
419+
completedAt: null,
420+
checkpointId: null,
421+
contextHandoffId: null,
422+
},
423+
],
424+
turnItems: [
425+
{
426+
id: TurnItemId.make("background-command"),
427+
threadId: v2ThreadId,
428+
runId: waitingRunId,
429+
nodeId: null,
430+
providerThreadId: null,
431+
providerTurnId: null,
432+
nativeItemRef: null,
433+
parentItemId: null,
434+
ordinal: 1,
435+
status: "running",
436+
title: null,
437+
startedAt: v2Now,
438+
completedAt: null,
439+
updatedAt: v2Now,
440+
type: "command_execution",
441+
input: "vp run dev",
442+
},
443+
],
444+
};
445+
const commands: OrchestrationV2Command[] = [];
446+
const supervisor = yield* makeSupervisor({ commands, projects: [], projection });
447+
448+
const result = yield* interruptThreadTurn({ threadId: v2ThreadId }).pipe(
449+
Effect.provideService(EnvironmentSupervisor.EnvironmentSupervisor, supervisor),
450+
);
451+
452+
expect(result).toEqual({ sequence: status === "rolled_back" ? 0 : 1 });
453+
expect(commands).toEqual(
454+
status === "rolled_back"
455+
? []
456+
: [
457+
{
458+
type: "run.interrupt",
459+
commandId: expect.any(String),
460+
threadId: v2ThreadId,
461+
runId: waitingRunId,
462+
holdQueue: true,
463+
},
464+
],
465+
);
466+
}).pipe(Effect.provide(layerTestCrypto)),
472467
);
473468

474469
it.effect("validates identified checkpoints locally for older servers", () =>

‎packages/client-runtime/src/pullRequestLinkInput.test.ts‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -120,20 +120,10 @@ describe("parsePullRequestReference", () => {
120120
expect(parsePullRequestReference("gh pr checkout 42")).toBe("42");
121121
});
122122

123-
it("accepts gh pr checkout commands with GitHub pull request URLs", () => {
124-
expect(
125-
parsePullRequestReference("gh pr checkout https://github.com/pingdotgg/t3code/pull/42"),
126-
).toBe("https://github.com/pingdotgg/t3code/pull/42");
127-
});
128-
129123
it("accepts glab mr checkout commands with raw numbers", () => {
130124
expect(parsePullRequestReference("glab mr checkout 42")).toBe("42");
131125
});
132126

133-
it("accepts az repos pr checkout commands with raw numbers", () => {
134-
expect(parsePullRequestReference("az repos pr checkout --id 42")).toBe("42");
135-
});
136-
137127
it("accepts az repos pr checkout commands with equals-style ids", () => {
138128
expect(parsePullRequestReference("az repos pr checkout --id=42")).toBe("42");
139129
});

‎packages/client-runtime/src/pullRequestQuery.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ describe("colon-namespaced labels typed as a search", () => {
7878
expect(parsePullRequestQuery("size:S,size:XS").filters.labels).toEqual([["size:S", "size:XS"]]);
7979
});
8080

81+
// regression: #19934 negated key:value qualifiers become namespaced label exclusions
8182
it("excludes one the same way", () => {
8283
expect(parsePullRequestQuery("-size:XXL").filters.excludedLabels).toEqual(["size:XXL"]);
8384
expect(parsePullRequestQuery("-size:S,XS").filters.excludedLabels).toEqual([

‎packages/client-runtime/src/relay/managedRelay.test.ts‎

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -455,74 +455,4 @@ describe("ManagedRelayClient", () => {
455455
}
456456
}).pipe(Effect.provide(layerManagedRelayTest(fetchFn)));
457457
});
458-
459-
it.effect("lists account devices through the v2 Clerk bearer client endpoint", () => {
460-
const fetchFn = ((input, init) => {
461-
expect(String(input)).toBe("https://relay.example.test/v2/client/devices");
462-
expect(init?.headers).toMatchObject({
463-
authorization: "Bearer clerk-token",
464-
});
465-
return Promise.resolve(
466-
Response.json({
467-
devices: [
468-
{
469-
deviceId: "device-1",
470-
label: "Julius's iPhone",
471-
platform: "ios",
472-
iosMajorVersion: 18,
473-
appVersion: "1.0.0",
474-
notifications: {
475-
enabled: false,
476-
notifyOnApproval: true,
477-
notifyOnInput: true,
478-
notifyOnCompletion: true,
479-
notifyOnFailure: true,
480-
},
481-
liveActivities: {
482-
enabled: true,
483-
},
484-
updatedAt: "2026-06-01T00:00:00.000Z",
485-
},
486-
{
487-
deviceId: "device-2",
488-
label: "Android phone",
489-
platform: "android",
490-
iosMajorVersion: null,
491-
androidApiLevel: 36,
492-
appVersion: "1.0.0",
493-
notifications: {
494-
enabled: true,
495-
notifyOnApproval: true,
496-
notifyOnInput: true,
497-
notifyOnCompletion: true,
498-
notifyOnFailure: true,
499-
},
500-
liveActivities: { enabled: true },
501-
updatedAt: "2026-06-01T00:00:00.000Z",
502-
},
503-
],
504-
}),
505-
);
506-
}) satisfies typeof globalThis.fetch;
507-
508-
return Effect.gen(function* () {
509-
const relayClient = yield* ManagedRelay.ManagedRelayClient;
510-
const devices = yield* relayClient.listDevices({ clerkToken: "clerk-token" });
511-
expect(devices).toMatchObject([
512-
{
513-
deviceId: "device-1",
514-
label: "Julius's iPhone",
515-
notifications: {
516-
enabled: false,
517-
},
518-
},
519-
{
520-
deviceId: "device-2",
521-
platform: "android",
522-
iosMajorVersion: null,
523-
androidApiLevel: 36,
524-
},
525-
]);
526-
}).pipe(Effect.provide(layerManagedRelayTest(fetchFn)));
527-
});
528458
});

0 commit comments

Comments
 (0)