@@ -4,14 +4,9 @@ import { mkdir, readFile, writeFile, rm, access } from "fs/promises";
44import { join } from "path" ;
55import { tmpdir } from "os" ;
66
7- const trackEvent = vi . fn ( ) ;
87const mockCheckboxWithHover = vi . fn ( ) ;
98let logOutput : string [ ] ;
109
11- vi . mock ( "../utils/tracking.js" , ( ) => ( {
12- trackEvent : ( ...args : unknown [ ] ) => trackEvent ( ...args ) ,
13- } ) ) ;
14-
1510vi . mock ( "../utils/prompts.js" , ( ) => ( {
1611 checkboxWithHover : ( ...args : unknown [ ] ) => mockCheckboxWithHover ( ...args ) ,
1712} ) ) ;
@@ -83,12 +78,6 @@ describe("remove command", () => {
8378 expect ( await exists ( rulePath ) ) . toBe ( false ) ;
8479 expect ( await exists ( join ( tempDir , ".cursor" , "skills" , "find-docs" ) ) ) . toBe ( false ) ;
8580 expect ( await exists ( mcpSkillPath ) ) . toBe ( true ) ;
86- expect ( trackEvent ) . toHaveBeenCalledWith ( "command" , { name : "remove" } ) ;
87- expect ( trackEvent ) . toHaveBeenCalledWith ( "remove" , {
88- agents : [ "cursor" ] ,
89- scope : "project" ,
90- modes : [ "cli" ] ,
91- } ) ;
9281 } ) ;
9382
9483 test ( "removes only MCP artifacts for codex project setup" , async ( ) => {
@@ -123,11 +112,6 @@ describe("remove command", () => {
123112 expect ( tomlContent ) . not . toContain ( "[mcp_servers.context7]" ) ;
124113 expect ( await exists ( join ( tempDir , ".agents" , "skills" , "context7-mcp" ) ) ) . toBe ( false ) ;
125114 expect ( await exists ( cliSkillPath ) ) . toBe ( true ) ;
126- expect ( trackEvent ) . toHaveBeenCalledWith ( "remove" , {
127- agents : [ "codex" ] ,
128- scope : "project" ,
129- modes : [ "mcp" ] ,
130- } ) ;
131115 } ) ;
132116
133117 test ( "supports uninstall alias and --all to remove both setup modes" , async ( ) => {
@@ -159,11 +143,6 @@ describe("remove command", () => {
159143 expect ( await exists ( join ( tempDir , ".agents" , "skills" , "context7-mcp" ) ) ) . toBe ( false ) ;
160144 expect ( await exists ( join ( tempDir , ".agents" , "skills" , "find-docs" ) ) ) . toBe ( false ) ;
161145 expect ( await readFile ( tomlPath , "utf-8" ) ) . not . toContain ( "[mcp_servers.context7]" ) ;
162- expect ( trackEvent ) . toHaveBeenCalledWith ( "remove" , {
163- agents : [ "codex" ] ,
164- scope : "project" ,
165- modes : [ "mcp" , "cli" ] ,
166- } ) ;
167146 } ) ;
168147
169148 test ( "skips mode prompt when only one setup mode exists" , async ( ) => {
@@ -186,11 +165,6 @@ describe("remove command", () => {
186165 expect ( await exists ( rulePath ) ) . toBe ( false ) ;
187166 expect ( await exists ( join ( tempDir , ".cursor" , "skills" , "find-docs" ) ) ) . toBe ( false ) ;
188167 expect ( await exists ( mcpSkillPath ) ) . toBe ( false ) ;
189- expect ( trackEvent ) . toHaveBeenCalledWith ( "remove" , {
190- agents : [ "cursor" ] ,
191- scope : "project" ,
192- modes : [ "cli" ] ,
193- } ) ;
194168 } ) ;
195169
196170 test ( "prompts for setup mode when both MCP and CLI artifacts exist" , async ( ) => {
@@ -225,11 +199,6 @@ describe("remove command", () => {
225199 expect ( await exists ( join ( tempDir , ".agents" , "skills" , "find-docs" ) ) ) . toBe ( false ) ;
226200 expect ( await exists ( mcpSkillPath ) ) . toBe ( true ) ;
227201 expect ( await readFile ( tomlPath , "utf-8" ) ) . toContain ( "[mcp_servers.context7]" ) ;
228- expect ( trackEvent ) . toHaveBeenCalledWith ( "remove" , {
229- agents : [ "codex" ] ,
230- scope : "project" ,
231- modes : [ "cli" ] ,
232- } ) ;
233202 } ) ;
234203
235204 test ( "does not log not found items when other artifacts were removed" , async ( ) => {
0 commit comments