Skip to content

Commit 7e733be

Browse files
committed
test: simplify copilot live text extraction
1 parent 05414e2 commit 7e733be

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

extensions/github-copilot/connection-bound-ids.live.test.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,16 @@ function extractText(response: unknown): string {
133133
if (!Array.isArray(content)) {
134134
return "";
135135
}
136-
return content
137-
.filter((block) => block.type === "text")
138-
.map((block) => block.text?.trim() ?? "")
139-
.filter(Boolean)
140-
.join(" ");
136+
const text: string[] = [];
137+
for (const block of content) {
138+
if (block.type === "text") {
139+
const trimmed = block.text?.trim() ?? "";
140+
if (trimmed.length > 0) {
141+
text.push(trimmed);
142+
}
143+
}
144+
}
145+
return text.join(" ");
141146
}
142147

143148
describeLive("github-copilot connection-bound Responses IDs live", () => {

0 commit comments

Comments
 (0)