Skip to content

Commit 680f932

Browse files
test(core): Refactor plan path resolution test in write-file.test.ts
1 parent e788e59 commit 680f932

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

packages/core/src/tools/write-file.test.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,12 +1120,10 @@ describe('WriteFileTool', () => {
11201120

11211121
it('should correctly resolve nested paths in plan mode', async () => {
11221122
vi.mocked(mockConfig.isPlanMode).mockReturnValue(true);
1123-
if (!mockConfig.storage) {
1124-
Object.assign(mockConfig, { storage: {} });
1125-
}
1123+
// Extend storage mock with getPlansDir
11261124
mockConfig.storage.getPlansDir = vi.fn().mockReturnValue(plansDir);
1127-
const nestedFilePath = 'conductor/tracks/test.md';
11281125

1126+
const nestedFilePath = 'conductor/tracks/test.md';
11291127
const invocation = tool.build({
11301128
file_path: nestedFilePath,
11311129
content: 'nested content',
@@ -1134,9 +1132,6 @@ describe('WriteFileTool', () => {
11341132
await invocation.execute({ abortSignal });
11351133

11361134
const expectedWritePath = path.join(plansDir, 'conductor/tracks/test.md');
1137-
1138-
// Need to find exactly what to assert on, checking if the file actually exists
1139-
// in the mock file system since it's hard to assert on the exact service mock in this file
11401135
expect(fs.existsSync(expectedWritePath)).toBe(true);
11411136
expect(fs.readFileSync(expectedWritePath, 'utf8')).toBe('nested content');
11421137
});

0 commit comments

Comments
 (0)