diff options
Diffstat (limited to 'packages/cli/src/ui/utils/commandUtils.test.ts')
| -rw-r--r-- | packages/cli/src/ui/utils/commandUtils.test.ts | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/packages/cli/src/ui/utils/commandUtils.test.ts b/packages/cli/src/ui/utils/commandUtils.test.ts index 4bd48cee..db333e72 100644 --- a/packages/cli/src/ui/utils/commandUtils.test.ts +++ b/packages/cli/src/ui/utils/commandUtils.test.ts @@ -11,6 +11,7 @@ import { isAtCommand, isSlashCommand, copyToClipboard, + getUrlOpenCommand, } from './commandUtils.js'; // Mock child_process @@ -342,4 +343,42 @@ describe('commandUtils', () => { }); }); }); + + describe('getUrlOpenCommand', () => { + describe('on macOS (darwin)', () => { + beforeEach(() => { + mockProcess.platform = 'darwin'; + }); + it('should return open', () => { + expect(getUrlOpenCommand()).toBe('open'); + }); + }); + + describe('on Windows (win32)', () => { + beforeEach(() => { + mockProcess.platform = 'win32'; + }); + it('should return start', () => { + expect(getUrlOpenCommand()).toBe('start'); + }); + }); + + describe('on Linux (linux)', () => { + beforeEach(() => { + mockProcess.platform = 'linux'; + }); + it('should return xdg-open', () => { + expect(getUrlOpenCommand()).toBe('xdg-open'); + }); + }); + + describe('on unmatched OS', () => { + beforeEach(() => { + mockProcess.platform = 'unmatched'; + }); + it('should return xdg-open', () => { + expect(getUrlOpenCommand()).toBe('xdg-open'); + }); + }); + }); }); |
