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

cli: use kebab-case for --retry-tag-filter arg #1293

Merged
merged 14 commits into from
Mar 17, 2020
Prev Previous commit
Next Next commit
log warnings to stderr not stdout
davidjgoss committed Mar 7, 2020
commit a9dea8c033e2bc4f7b7ef486897b484f19a09e3e
2 changes: 1 addition & 1 deletion features/retry.feature
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ Feature: Retry flaky tests
Given(/^a step$/, function() {})
"""
When I run cucumber-js with `--retry 1 --retryTagFilter @flaky`
Then the output contains the text:
Then the error output contains the text:
"""
the argument --retryTagFilter is deprecated and will be removed in a future release; please use --retry-tag-filter
"""
14 changes: 10 additions & 4 deletions features/support/world.ts
Original file line number Diff line number Diff line change
@@ -60,25 +60,31 @@ export class World {
})
} else {
const stdout = new PassThrough()
const stderr = new PassThrough()
const cli = new Cli({
argv: args,
cwd,
stdout,
stderr,
})
let error: any, stderr: string
let error: any
try {
const { success } = await cli.run()
if (!success) {
error = new Error('CLI exited with non-zero')
error.code = 42
}
stderr = ''
} catch (err) {
error = err
stderr = VError.fullStack(error)
stderr.write(VError.fullStack(error))
}
stdout.end()
result = { error, stdout: await toString(stdout), stderr }
stderr.end()
result = {
error,
stdout: await toString(stdout),
stderr: await toString(stderr),
}
}
const envelopes: messages.Envelope[] = []
const messageOutputPath = path.join(cwd, messageFilename)
4 changes: 2 additions & 2 deletions src/cli/index.ts
Original file line number Diff line number Diff line change
@@ -45,11 +45,11 @@ export default class Cli {
private readonly stdout: IFormatterStream
private readonly console: Console

constructor({ argv, cwd, stdout }) {
constructor({ argv, cwd, stdout, stderr }) {
this.argv = argv
this.cwd = cwd
this.stdout = stdout
this.console = new Console(stdout)
this.console = new Console(stderr)
}

async getConfiguration(): Promise<IConfiguration> {
1 change: 1 addition & 0 deletions src/cli/run.ts
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@ export default async function run(): Promise<void> {
argv: process.argv,
cwd,
stdout: process.stdout,
stderr: process.stderr,
})

let result: ICliRunResult