Skip to content

Commit

Permalink
Omit outputting empty "then" entries to the command log
Browse files Browse the repository at this point in the history
Relates to #1214 [1].

This is unfortunately highly dependant on Cypress' implementation
details and cumbersome (at best) to test. Hopefully this doesn't have
any adverse side effects.

[1] #1214
  • Loading branch information
badeball committed Jul 23, 2024
1 parent 85c77e3 commit 5a42588
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to this project will be documented in this file.

## Unreleased

- Omit outputting empty "then" entries to the command log, relates to [#1214](https://github.com/badeball/cypress-cucumber-preprocessor/discussions/1214).

## v20.1.0

- Include skipped (not omitted) tests in reports, fixes [#1041](https://github.com/badeball/cypress-cucumber-preprocessor/issues/1041).
Expand Down
4 changes: 2 additions & 2 deletions lib/helpers/cypress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function runStepWithLogGroup(options: {
argument?: DataTable | string;
text?: string;
}) {
Cypress.log({
const log = Cypress.log({
name: options.keyword,
message: options.text == null ? "" : `**${options.text}**`,
groupStart: true,
Expand Down Expand Up @@ -71,7 +71,7 @@ export function runStepWithLogGroup(options: {
}

return ensureChain(ret).then((result) => {
Cypress.log({ groupEnd: true, emitOnly: true } as object);
(log as any).endGroup();
return result;
});
}

0 comments on commit 5a42588

Please sign in to comment.