mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-02 08:33:36 +00:00
refactor(platform): address code review feedback for node-finder
- Extract VERSION_DIR_PATTERN regex to named constant - Pass logger to findNodeViaShell for consistent debug logging - Fix buildEnhancedPath to not add trailing delimiter for empty currentPath 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -87,12 +87,12 @@ describe('node-finder', () => {
|
||||
expect(result).toBe(currentPath);
|
||||
});
|
||||
|
||||
it('should handle empty currentPath', () => {
|
||||
it('should handle empty currentPath without trailing delimiter', () => {
|
||||
const nodePath = '/opt/homebrew/bin/node';
|
||||
|
||||
const result = buildEnhancedPath(nodePath, '');
|
||||
|
||||
expect(result).toBe(`/opt/homebrew/bin${delimiter}`);
|
||||
expect(result).toBe('/opt/homebrew/bin');
|
||||
});
|
||||
|
||||
it('should handle Windows-style paths', () => {
|
||||
@@ -118,7 +118,7 @@ describe('node-finder', () => {
|
||||
|
||||
const result = buildEnhancedPath(nodePath);
|
||||
|
||||
expect(result).toBe(`/usr/local/bin${delimiter}`);
|
||||
expect(result).toBe('/usr/local/bin');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user