Skip to content

Commit 4c18c5e

Browse files
committed
refactor: streamline error handling in configure-tool and clean up test files
1 parent 4e6c905 commit 4c18c5e

File tree

4 files changed

+3
-5
lines changed

4 files changed

+3
-5
lines changed

pnpm-workspace.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
ignoredBuiltDependencies:
2-
- esbuild
2+
- esbuild

src/commands/init/configure-tool.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ function readJsonFile(configPath: string): Record<string, unknown> {
6868
throw new Error(
6969
`Failed to parse ${configPath}: ${err instanceof Error ? err.message : String(err)}. ` +
7070
`Fix the JSON manually or delete the file and re-run yavy init.`,
71+
{ cause: err },
7172
);
7273
}
7374
}

tests/commands/init.test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,7 @@ describe('initCommand', () => {
159159

160160
it('filters projects to only indexed ones', async () => {
161161
vi.mocked(scanForTools).mockReturnValue([AiTool.ClaudeCode]);
162-
vi.mocked(p.multiselect)
163-
.mockResolvedValueOnce([AiTool.ClaudeCode])
164-
.mockResolvedValueOnce(['indexed-proj']);
162+
vi.mocked(p.multiselect).mockResolvedValueOnce([AiTool.ClaudeCode]).mockResolvedValueOnce(['indexed-proj']);
165163

166164
mockClient([
167165
makeProject({ slug: 'indexed-proj', has_indexed_content: true }),

tests/commands/init/scan-tools.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ describe('scanForTools', () => {
3535
vi.mocked(existsSync).mockReturnValue(true);
3636
expect(scanForTools('/project')).toEqual([AiTool.ClaudeCode, AiTool.Cursor, AiTool.Vscode, AiTool.Windsurf, AiTool.OpenCode]);
3737
});
38-
3938
});
4039

4140
describe('resolveToolFromFlag', () => {

0 commit comments

Comments
 (0)