Skip to content

Commit 197cadd

Browse files
committed
test: strengthen inspectMcpTargets assertion from .some() to exact target checks
The test used .some() which would pass even if targets were duplicated or had wrong configured flags. Now checks exact count (3), and verifies each target's configured status individually. Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
1 parent 68254a2 commit 197cadd

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

test/unit/initializeProject.test.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,16 @@ test("inspectMcpTargets reports configured targets", async () => {
262262
}
263263
});
264264

265-
assert.equal(targets.some((target) => target.kind === "vscode-workspace" && target.configured), true);
266-
assert.equal(targets.some((target) => target.kind === "windsurf-user"), true);
265+
assert.equal(targets.length, 3, "should return vscode-workspace, cursor-workspace, windsurf-user");
266+
const vscode = targets.find((t) => t.kind === "vscode-workspace");
267+
const cursor = targets.find((t) => t.kind === "cursor-workspace");
268+
const windsurf = targets.find((t) => t.kind === "windsurf-user");
269+
assert.ok(vscode);
270+
assert.equal(vscode.configured, true, "vscode-workspace should be configured");
271+
assert.ok(cursor);
272+
assert.equal(cursor.configured, false, "cursor-workspace should not be configured");
273+
assert.ok(windsurf);
274+
assert.equal(windsurf.configured, false, "windsurf-user should not be configured");
267275
});
268276

269277
test("configureMcpTargets creates or updates only the selected target kinds", async () => {

0 commit comments

Comments
 (0)