mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-30 23:14:32 -07:00
test: fix Windows CI execution and resolve exposed platform failures (#24476)
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
||||
import * as path from 'node:path';
|
||||
import {
|
||||
resolvePathFromEnv,
|
||||
isSectionEnabled,
|
||||
@@ -123,24 +124,25 @@ describe('resolvePathFromEnv', () => {
|
||||
});
|
||||
|
||||
it('should resolve a regular path', () => {
|
||||
const result = resolvePathFromEnv('/some/absolute/path');
|
||||
const p = path.resolve('/some/absolute/path');
|
||||
const result = resolvePathFromEnv(p);
|
||||
expect(result.isSwitch).toBe(false);
|
||||
expect(result.value).toBe('/some/absolute/path');
|
||||
expect(result.value).toBe(p);
|
||||
expect(result.isDisabled).toBe(false);
|
||||
});
|
||||
|
||||
it('should resolve a tilde path to the home directory', () => {
|
||||
const result = resolvePathFromEnv('~/my/custom/path');
|
||||
expect(result.isSwitch).toBe(false);
|
||||
expect(result.value).toContain('/mock/home');
|
||||
expect(result.value).toContain('my/custom/path');
|
||||
expect(result.value).toContain(path.normalize('/mock/home'));
|
||||
expect(result.value).toContain(path.normalize('my/custom/path'));
|
||||
expect(result.isDisabled).toBe(false);
|
||||
});
|
||||
|
||||
it('should resolve a bare tilde to the home directory', () => {
|
||||
const result = resolvePathFromEnv('~');
|
||||
expect(result.isSwitch).toBe(false);
|
||||
expect(result.value).toBe('/mock/home');
|
||||
expect(result.value).toBe(path.resolve('/mock/home'));
|
||||
expect(result.isDisabled).toBe(false);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user