Skip to content

Commit

Permalink
feat(config): remove legacy dash-based props (#3371)
Browse files Browse the repository at this point in the history
BREAKING: removes test-runner and runner-config props
from Detox global config. Use testRunner and runnerConfig
instead.
  • Loading branch information
noomorph authored May 3, 2022
1 parent 8b7a763 commit b67b07c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
4 changes: 2 additions & 2 deletions detox/src/configuration/composeRunnerConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 0 additions & 12 deletions detox/src/configuration/composeRunnerConfig.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
Expand All @@ -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');
Expand Down

0 comments on commit b67b07c

Please sign in to comment.