fix(config): change default automation mode from production to mock
This commit is contained in:
@@ -51,7 +51,7 @@ export interface AutomationEnvironmentConfig {
|
||||
*/
|
||||
export function loadAutomationConfig(): AutomationEnvironmentConfig {
|
||||
const modeEnv = process.env.AUTOMATION_MODE;
|
||||
const mode: AutomationMode = isValidAutomationMode(modeEnv) ? modeEnv : 'production';
|
||||
const mode: AutomationMode = isValidAutomationMode(modeEnv) ? modeEnv : 'mock';
|
||||
|
||||
return {
|
||||
mode,
|
||||
|
||||
@@ -16,12 +16,12 @@ describe('AutomationConfig', () => {
|
||||
|
||||
describe('loadAutomationConfig', () => {
|
||||
describe('default configuration', () => {
|
||||
it('should return production mode when AUTOMATION_MODE is not set', () => {
|
||||
it('should return mock mode when AUTOMATION_MODE is not set', () => {
|
||||
delete process.env.AUTOMATION_MODE;
|
||||
|
||||
const config = loadAutomationConfig();
|
||||
|
||||
expect(config.mode).toBe('production');
|
||||
expect(config.mode).toBe('mock');
|
||||
});
|
||||
|
||||
it('should return default devTools configuration', () => {
|
||||
@@ -161,12 +161,12 @@ describe('AutomationConfig', () => {
|
||||
expect(config.nutJs?.confidence).toBe(0.9);
|
||||
});
|
||||
|
||||
it('should fallback to production mode for invalid AUTOMATION_MODE', () => {
|
||||
it('should fallback to mock mode for invalid AUTOMATION_MODE', () => {
|
||||
process.env.AUTOMATION_MODE = 'invalid-mode';
|
||||
|
||||
const config = loadAutomationConfig();
|
||||
|
||||
expect(config.mode).toBe('production');
|
||||
expect(config.mode).toBe('mock');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user