Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(test): logLevel debug in proxy test #3427

Merged
merged 1 commit into from
Feb 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions test/e2e/step_definitions/core_steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,17 +180,18 @@ cucumber.defineSupportCode((a) => {
})

When('I {command} Karma behind a proxy on port {int} that prepends {string} to the base path', function (command, proxyPort, proxyPath, callback) {
execKarma.apply(this, [command, undefined, proxyPort, proxyPath, callback])
execKarma.apply(this, [command, 'debug', proxyPort, proxyPath, callback])
})

defineParameterType({
name: 'exact',
regexp: /no\sdebug|like/
regexp: /no\sdebug|like|regexp/
})

Then('it passes with( {exact}):', { timeout: 10 * 1000 }, function (mode, expectedOutput, callback) {
const noDebug = mode === 'no debug'
const like = mode === 'like'
const regexp = mode === 'regexp'
let actualOutput = this.lastRun.stdout.toString()
let lines

Expand All @@ -203,7 +204,9 @@ cucumber.defineSupportCode((a) => {
if (like && actualOutput.indexOf(expectedOutput) >= 0) {
return callback()
}

if (regexp && actualOutput.match(expectedOutput)) {
return callback()
}
if (actualOutput.indexOf(expectedOutput) === 0) {
return callback()
}
Expand All @@ -212,7 +215,7 @@ cucumber.defineSupportCode((a) => {
return callback(new Error('Expected output to match the following:\n ' + expectedOutput + '\nGot:\n ' + actualOutput))
}

callback(new Error('Failed all comparissons'))
callback(new Error('Failed all comparisons'))
})

Then('it fails with:', function (expectedOutput, callback) {
Expand Down
5 changes: 2 additions & 3 deletions test/e2e/upstream-proxy.feature
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ Feature: UpstreamProxy
};
"""
When I start Karma behind a proxy on port 9875 that prepends '/__proxy__/' to the base path
Then it passes with:
Then it passes with regexp:
"""
..
HeadlessChrome
HeadlessChrome.*Executed.*SUCCESS
"""