Skip to content

Commit

Permalink
refactor(test): write config file in its own steps (#3494)
Browse files Browse the repository at this point in the history
From the description of the steps it makes sense to write it straight away. Also this is more flexible and allows to introduce steps, which do not require config file in the future PR.
  • Loading branch information
devoto13 authored May 5, 2020
1 parent 0bd5c2b commit e4a5126
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/e2e/step_definitions/core_steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ let additionalArgs = []
function execKarma (command, level, callback) {
level = level || 'warn'

this.writeConfigFile()

const configFile = this.configFile
const runtimePath = this.karmaExecutable
const baseDir = this.workDir
Expand Down Expand Up @@ -75,8 +73,13 @@ function execKarma (command, level, callback) {
}
}

Given('a default configuration', function () {
this.writeConfigFile()
})

Given('a configuration with:', function (fileContent) {
this.updateConfig(fileContent)
this.writeConfigFile()
})

Given('command line arguments of: {string}', function (args, callback) {
Expand Down
1 change: 1 addition & 0 deletions test/e2e/stop.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Feature: Stop karma
I want to be able to stop Karma.

Scenario: A server can't be stopped if it isn't running
Given a default configuration
When I stop Karma
Then it fails with like:
"""
Expand Down

0 comments on commit e4a5126

Please sign in to comment.