Skip to content

Commit

Permalink
Minor cleanup to avoid getSpecs call (#4881)
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-bromann committed Dec 14, 2019
1 parent ed99355 commit c4def4c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions packages/wdio-cli/src/interface.js
Expand Up @@ -7,7 +7,7 @@ import { getRunnerName } from './utils'
const log = logger('@wdio/cli')

export default class WDIOCLInterface extends EventEmitter {
constructor (config, specs, totalWorkerCnt, isWatchMode = false) {
constructor (config, totalWorkerCnt, isWatchMode = false) {
super()

/**
Expand All @@ -16,7 +16,6 @@ export default class WDIOCLInterface extends EventEmitter {
* `FORCE_COLOR=0` - forcibly disable colors
*/
this.hasAnsiSupport = !!chalk.supportsColor.hasBasic
this.specs = specs
this.config = config
this.totalWorkerCnt = totalWorkerCnt
this.isWatchMode = isWatchMode
Expand Down
3 changes: 1 addition & 2 deletions packages/wdio-cli/src/launcher.js
Expand Up @@ -22,7 +22,6 @@ class Launcher {

const config = this.configParser.getConfig()
const capabilities = this.configParser.getCapabilities()
const specs = this.configParser.getSpecs()

this.isWatchMode = isWatchMode

Expand All @@ -42,7 +41,7 @@ class Launcher {
const Runner = initialisePlugin(config.runner, 'runner')
this.runner = new Runner(configFilePath, config)

this.interface = new CLInterface(config, specs, totalWorkerCnt, this.isWatchMode)
this.interface = new CLInterface(config, totalWorkerCnt, this.isWatchMode)
config.runnerEnv.FORCE_COLOR = Number(this.interface.hasAnsiSupport)

this.isMultiremote = !Array.isArray(capabilities)
Expand Down
3 changes: 1 addition & 2 deletions packages/wdio-cli/tests/interface.test.js
Expand Up @@ -2,14 +2,13 @@ import WDIOCLInterface from '../src/interface'
import chalk from 'chalk'

const config = {}
const specs = ['/some/path/to/test.js']
global.console.log = jest.fn()

describe('cli interface', () => {
let wdioClInterface

beforeEach(() => {
wdioClInterface = new WDIOCLInterface(config, specs, 5)
wdioClInterface = new WDIOCLInterface(config, 5)
wdioClInterface.log = jest.fn().mockImplementation((...args) => args)
})

Expand Down

0 comments on commit c4def4c

Please sign in to comment.