test: fix test environments failing due to missing IS_DEV_ENVIRONMENT mock export
This commit is contained in:
1 parent
9b9b977ae6
commit
269ad18ed6
10 files changed
+10
No files matched your search
@@ -17,6 +17,7 @@ vi.mock('../../utils/paths', async () => {
|
|||||||
const path = await import('path');
|
const path = await import('path');
|
||||||
const agentDir = path.join(process.cwd(), 'temp_test_agent');
|
const agentDir = path.join(process.cwd(), 'temp_test_agent');
|
||||||
return {
|
return {
|
||||||
|
IS_DEV_ENVIRONMENT: false,
|
||||||
getAgentDir: vi.fn(() => agentDir),
|
getAgentDir: vi.fn(() => agentDir),
|
||||||
getAccountsFilePath: vi.fn(() => path.join(agentDir, 'accounts.json')),
|
getAccountsFilePath: vi.fn(() => path.join(agentDir, 'accounts.json')),
|
||||||
getBackupsDir: vi.fn(() => path.join(agentDir, 'backups')),
|
getBackupsDir: vi.fn(() => path.join(agentDir, 'backups')),
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ vi.mock('../../ipc/database/dbConnection', () => ({
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
vi.mock('../../utils/paths', () => ({
|
vi.mock('../../utils/paths', () => ({
|
||||||
|
IS_DEV_ENVIRONMENT: false,
|
||||||
getGeminiNexusDbPaths: () => ['mock-db'],
|
getGeminiNexusDbPaths: () => ['mock-db'],
|
||||||
getCloudAccountsDbPath: () => 'mock-cloud-db',
|
getCloudAccountsDbPath: () => 'mock-cloud-db',
|
||||||
getAgentDir: vi.fn(() => '/mock/agent/dir'),
|
getAgentDir: vi.fn(() => '/mock/agent/dir'),
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ vi.mock('../../ipc/database/dbConnection', () => ({
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
vi.mock('../../utils/paths', () => ({
|
vi.mock('../../utils/paths', () => ({
|
||||||
|
IS_DEV_ENVIRONMENT: false,
|
||||||
getGeminiNexusDbPaths: () => ['mock-db'],
|
getGeminiNexusDbPaths: () => ['mock-db'],
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ vi.mock('../../utils/logger', () => ({
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
vi.mock('../../utils/paths', () => ({
|
vi.mock('../../utils/paths', () => ({
|
||||||
|
IS_DEV_ENVIRONMENT: false,
|
||||||
getGeminiNexusDbPaths: vi.fn().mockReturnValue(['/tmp/test.vscdb']),
|
getGeminiNexusDbPaths: vi.fn().mockReturnValue(['/tmp/test.vscdb']),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ vi.mock('../../../ipc/database/dbConnection', () => ({
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
vi.mock('../../../utils/paths', () => ({
|
vi.mock('../../../utils/paths', () => ({
|
||||||
|
IS_DEV_ENVIRONMENT: false,
|
||||||
getCloudAccountsDbPath: vi.fn(() => '/mock/db/path.sqlite'),
|
getCloudAccountsDbPath: vi.fn(() => '/mock/db/path.sqlite'),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ vi.mock('../../../utils/logger', () => ({
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
vi.mock('../../../utils/paths', () => ({
|
vi.mock('../../../utils/paths', () => ({
|
||||||
|
IS_DEV_ENVIRONMENT: false,
|
||||||
getGeminiNexusDbPaths: vi.fn().mockReturnValue(['/tmp/test.vscdb']),
|
getGeminiNexusDbPaths: vi.fn().mockReturnValue(['/tmp/test.vscdb']),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ vi.mock('../../../utils/logger', () => ({
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
vi.mock('../../../utils/paths', () => ({
|
vi.mock('../../../utils/paths', () => ({
|
||||||
|
IS_DEV_ENVIRONMENT: false,
|
||||||
getGeminiNexusStoragePaths: vi.fn().mockReturnValue(['/tmp/storage.json']),
|
getGeminiNexusStoragePaths: vi.fn().mockReturnValue(['/tmp/storage.json']),
|
||||||
getGeminiNexusDbPaths: vi.fn().mockReturnValue(['/tmp/state.vscdb']),
|
getGeminiNexusDbPaths: vi.fn().mockReturnValue(['/tmp/state.vscdb']),
|
||||||
getAgentDir: vi.fn().mockReturnValue('/tmp/agent'),
|
getAgentDir: vi.fn().mockReturnValue('/tmp/agent'),
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ vi.mock('../../../ipc/database/cloudHandler', () => ({
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
vi.mock('../../../utils/paths', () => ({
|
vi.mock('../../../utils/paths', () => ({
|
||||||
|
IS_DEV_ENVIRONMENT: false,
|
||||||
getCloudAccountsDbPath: vi.fn(() => '/mock/db/path.sqlite'),
|
getCloudAccountsDbPath: vi.fn(() => '/mock/db/path.sqlite'),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import path from 'path';
|
|||||||
vi.mock('../../utils/paths', async () => {
|
vi.mock('../../utils/paths', async () => {
|
||||||
const path = await import('path');
|
const path = await import('path');
|
||||||
return {
|
return {
|
||||||
|
IS_DEV_ENVIRONMENT: false,
|
||||||
getAgentDir: vi.fn(() => path.join(process.cwd(), 'temp_test_logs')),
|
getAgentDir: vi.fn(() => path.join(process.cwd(), 'temp_test_logs')),
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ vi.mock('../../ipc/database/cloudHandler', () => ({
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
vi.mock('../../utils/paths', () => ({
|
vi.mock('../../utils/paths', () => ({
|
||||||
|
IS_DEV_ENVIRONMENT: false,
|
||||||
getCloudAccountsDbPath: vi.fn(() => '/mock/db/path.sqlite'),
|
getCloudAccountsDbPath: vi.fn(() => '/mock/db/path.sqlite'),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user