From 33c4744dd0ad1a017b6a0bb7bab96bb892d24fef Mon Sep 17 00:00:00 2001 From: Yaroslav Serhieiev Date: Tue, 3 May 2022 10:22:50 +0300 Subject: [PATCH] feat(config): remove legacy dash-based props BREAKING: removes test-runner and runner-config props from Detox global config. Use testRunner and runnerConfig instead. --- detox/src/configuration/composeRunnerConfig.js | 4 ++-- detox/src/configuration/composeRunnerConfig.test.js | 12 ------------ 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/detox/src/configuration/composeRunnerConfig.js b/detox/src/configuration/composeRunnerConfig.js index 30243be716..68f5602500 100644 --- a/detox/src/configuration/composeRunnerConfig.js +++ b/detox/src/configuration/composeRunnerConfig.js @@ -4,8 +4,8 @@ * @param {Detox.DetoxConfigurationOverrides} localConfig */ function composeRunnerConfig({ globalConfig, cliConfig }) { - const testRunner = globalConfig.testRunner || globalConfig['test-runner'] || 'jest'; - const customRunnerConfig = cliConfig.runnerConfig || globalConfig.runnerConfig || globalConfig['runner-config']; + const testRunner = globalConfig.testRunner || 'jest'; + const customRunnerConfig = cliConfig.runnerConfig || globalConfig.runnerConfig; return { testRunner, diff --git a/detox/src/configuration/composeRunnerConfig.test.js b/detox/src/configuration/composeRunnerConfig.test.js index 8853dcab14..88629766df 100644 --- a/detox/src/configuration/composeRunnerConfig.test.js +++ b/detox/src/configuration/composeRunnerConfig.test.js @@ -18,11 +18,6 @@ describe('composeRunnerConfig', () => { expect(composeRunnerConfig().testRunner).toBe('nyc jest'); }); - it('should take .test-runner from globalConfig', () => { - globalConfig['test-runner'] = 'nyc jest'; - expect(composeRunnerConfig().testRunner).toBe('nyc jest'); - }); - it('should set .testRunner to "jest" by default', () => { expect(composeRunnerConfig().testRunner).toBe('jest'); }); @@ -41,13 +36,6 @@ describe('composeRunnerConfig', () => { expect(composeRunnerConfig().runnerConfig).toBe('from/config.json'); }); - it('should take .runner-config from config if it is not defined via CLI', () => { - globalConfig['runner-config'] = 'from/config.json'; - delete cliConfig.runnerConfig; - - expect(composeRunnerConfig().runnerConfig).toBe('from/config.json'); - }); - it('should set .runnerConfig to e2e/config.json by default', () => { globalConfig.testRunner = 'jest'; expect(composeRunnerConfig().runnerConfig).toBe('e2e/config.json');