1+ import { markdownToRule } from "@continuedev/config-yaml" ;
12import { afterEach , beforeEach , describe , expect , it , vi } from "vitest" ;
23import { IDE } from "../.." ;
34import { walkDirs } from "../../indexing/walkDir" ;
45import { loadCodebaseRules } from "./loadCodebaseRules" ;
5- import { convertMarkdownRuleToContinueRule } from "./parseMarkdownRule" ;
66
77// Mock dependencies
88vi . mock ( "../../indexing/walkDir" , ( ) => ( {
99 walkDirs : vi . fn ( ) ,
1010} ) ) ;
1111
12- vi . mock ( "./parseMarkdownRule " , ( ) => ( {
13- convertMarkdownRuleToContinueRule : vi . fn ( ) ,
12+ vi . mock ( "@continuedev/config-yaml " , ( ) => ( {
13+ markdownToRule : vi . fn ( ) ,
1414} ) ) ;
1515
1616describe ( "loadCodebaseRules" , ( ) => {
@@ -82,10 +82,10 @@ describe("loadCodebaseRules", () => {
8282 return Promise . resolve ( mockRuleContent [ path ] || "" ) ;
8383 } ) ;
8484
85- // Mock convertMarkdownRuleToContinueRule to return converted rules
86- ( convertMarkdownRuleToContinueRule as any ) . mockImplementation (
87- ( path : string , content : string ) => {
88- return mockConvertedRules [ path ] ;
85+ // Mock markdownToRule to return converted rules
86+ ( markdownToRule as any ) . mockImplementation (
87+ ( content : string , options : any ) => {
88+ return mockConvertedRules [ options . filePath ] ;
8989 } ,
9090 ) ;
9191 } ) ;
@@ -107,7 +107,7 @@ describe("loadCodebaseRules", () => {
107107 expect ( mockIde . readFile ) . toHaveBeenCalledWith ( ".continue/rules.md" ) ;
108108
109109 // Should convert all rules
110- expect ( convertMarkdownRuleToContinueRule ) . toHaveBeenCalledTimes ( 4 ) ;
110+ expect ( markdownToRule ) . toHaveBeenCalledTimes ( 4 ) ;
111111
112112 // Should return all rules
113113 expect ( rules ) . toHaveLength ( 4 ) ;
0 commit comments