@@ -2,7 +2,6 @@ import { describe, it, expect } from 'vitest';
22import {
33 getContextFileType ,
44 isLoadableFile ,
5- getFilesByType ,
65 formatContextForAI ,
76 type ContextFile ,
87} from './context.loader' ;
@@ -62,45 +61,6 @@ describe('context.loader', () => {
6261 } ) ;
6362 } ) ;
6463
65- describe ( 'getFilesByType' , ( ) => {
66- const mockFiles : ContextFile [ ] = [
67- { path : 'context/arch.md' , content : 'arch' , type : 'context' , extension : '.md' } ,
68- { path : 'context/api.md' , content : 'api' , type : 'context' , extension : '.md' } ,
69- { path : 'prompts/review.md' , content : 'review' , type : 'prompt' , extension : '.md' } ,
70- { path : 'agents/dev.json' , content : '{}' , type : 'agent' , extension : '.json' } ,
71- { path : 'readme.md' , content : 'readme' , type : 'other' , extension : '.md' } ,
72- ] ;
73-
74- it ( 'should filter by context type' , ( ) => {
75- const result = getFilesByType ( mockFiles , 'context' ) ;
76- expect ( result ) . toHaveLength ( 2 ) ;
77- expect ( result . map ( ( f ) => f . path ) ) . toEqual ( [ 'context/arch.md' , 'context/api.md' ] ) ;
78- } ) ;
79-
80- it ( 'should filter by prompt type' , ( ) => {
81- const result = getFilesByType ( mockFiles , 'prompt' ) ;
82- expect ( result ) . toHaveLength ( 1 ) ;
83- expect ( result [ 0 ] . path ) . toBe ( 'prompts/review.md' ) ;
84- } ) ;
85-
86- it ( 'should filter by agent type' , ( ) => {
87- const result = getFilesByType ( mockFiles , 'agent' ) ;
88- expect ( result ) . toHaveLength ( 1 ) ;
89- expect ( result [ 0 ] . path ) . toBe ( 'agents/dev.json' ) ;
90- } ) ;
91-
92- it ( 'should filter by other type' , ( ) => {
93- const result = getFilesByType ( mockFiles , 'other' ) ;
94- expect ( result ) . toHaveLength ( 1 ) ;
95- expect ( result [ 0 ] . path ) . toBe ( 'readme.md' ) ;
96- } ) ;
97-
98- it ( 'should return empty array for no matches' , ( ) => {
99- const result = getFilesByType ( [ ] , 'context' ) ;
100- expect ( result ) . toEqual ( [ ] ) ;
101- } ) ;
102- } ) ;
103-
10464 describe ( 'formatContextForAI' , ( ) => {
10565 it ( 'should format context files correctly' , ( ) => {
10666 const files : ContextFile [ ] = [
0 commit comments