fix(automation): enable real OS automation for development mode

This commit is contained in:
2025-11-22 18:30:32 +01:00
parent 84800c663a
commit 73aaeb8b35
2 changed files with 5 additions and 4 deletions

View File

@@ -6,8 +6,8 @@
* *
* Mapping: * Mapping:
* - NODE_ENV=production → NutJsAutomationAdapter → iRacing Window → Image Templates * - NODE_ENV=production → NutJsAutomationAdapter → iRacing Window → Image Templates
* - NODE_ENV=development → NutJsAutomationAdapter → iRacing Window → Image Templates
* - NODE_ENV=test → MockBrowserAutomation → N/A → N/A * - NODE_ENV=test → MockBrowserAutomation → N/A → N/A
* - NODE_ENV=development → MockBrowserAutomation → N/A → N/A
*/ */
export type AutomationMode = 'production' | 'test'; export type AutomationMode = 'production' | 'test';
@@ -60,7 +60,8 @@ export function getAutomationMode(): AutomationMode {
} }
const nodeEnv = process.env.NODE_ENV; const nodeEnv = process.env.NODE_ENV;
if (nodeEnv === 'production') return 'production'; // Both production and development use real OS automation
if (nodeEnv === 'production' || nodeEnv === 'development') return 'production';
return 'test'; return 'test';
} }

View File

@@ -52,13 +52,13 @@ describe('AutomationConfig', () => {
expect(mode).toBe('test'); expect(mode).toBe('test');
}); });
it('should return test mode when NODE_ENV=development', () => { it('should return production mode when NODE_ENV=development', () => {
process.env.NODE_ENV = 'development'; process.env.NODE_ENV = 'development';
delete process.env.AUTOMATION_MODE; delete process.env.AUTOMATION_MODE;
const mode = getAutomationMode(); const mode = getAutomationMode();
expect(mode).toBe('test'); expect(mode).toBe('production');
}); });
}); });