Navigation Menu

Skip to content

Commit

Permalink
refactor(test): remove no debug matching option (#3504)
Browse files Browse the repository at this point in the history
There is no need to filter out [DEBUG] logs as tests are run with logLevel = "warn" by default.
  • Loading branch information
devoto13 committed May 11, 2020
1 parent 35d57e9 commit fdc4f9d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
2 changes: 1 addition & 1 deletion test/e2e/pass-opts.feature
Expand Up @@ -20,7 +20,7 @@ Feature: Passing Options
Executed 1 of 1 (1 FAILED)
"""
And I run Karma with additional arguments: "-- arg1 arg2"
Then it passes with no debug:
Then it passes with:
"""
.
"""
10 changes: 1 addition & 9 deletions test/e2e/step_definitions/core_steps.js
Expand Up @@ -51,19 +51,11 @@ When('I execute Karma with arguments: {string}', async function (args) {
await this.runForegroundProcess(args)
})

Then(/^it passes with(:? (no\sdebug|like|regexp))?:$/, { timeout: 10 * 1000 }, function (mode, expectedOutput, callback) {
const noDebug = mode === 'no debug'
Then(/^it passes with(:? (like|regexp))?:$/, { timeout: 10 * 1000 }, function (mode, expectedOutput, callback) {
const like = mode === 'like'
const regexp = mode === 'regexp'
let actualOutput = this.lastRun.stdout
let lines

if (noDebug) {
lines = actualOutput.split('\n').filter(function (line) {
return !line.match(/\[DEBUG\]/)
})
actualOutput = lines.join('\n')
}
if (like && actualOutput.indexOf(expectedOutput) >= 0) {
return callback()
}
Expand Down

0 comments on commit fdc4f9d

Please sign in to comment.