Skip to content

Commit 76a6924

Browse files
committed
fix(sdk): add mock handlers for ignore files in initial-session-state test
The test "discovers project files automatically when projectFiles is undefined" was failing because the mock filesystem did not handle .codebuffignore and .manicodeignore files that are checked during project file discovery. Added mock handlers in both readFile and exists methods.
1 parent 168751f commit 76a6924

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

sdk/src/__tests__/initial-session-state.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ describe('Initial Session State', () => {
2727
if (path.includes('.gitignore')) {
2828
return 'node_modules/\n.git/'
2929
}
30+
if (path.includes('.codebuffignore')) {
31+
return ''
32+
}
33+
if (path.includes('.manicodeignore')) {
34+
return ''
35+
}
3036
throw new Error(`File not found: ${path}`)
3137
},
3238
readdir: async (path: string) => {
@@ -62,6 +68,8 @@ describe('Initial Session State', () => {
6268
}) as any,
6369
exists: async (path: string) => {
6470
if (path.includes('.gitignore')) return true
71+
if (path.includes('.codebuffignore')) return true
72+
if (path.includes('.manicodeignore')) return true
6573
if (path.includes('src')) return true
6674
if (path.includes('.git')) return true
6775
if (path.includes('knowledge.md')) return true

0 commit comments

Comments
 (0)