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

Empty scenario unexpectedly produces test steps #124

Closed
davidjgoss opened this issue Aug 2, 2024 · 1 comment Β· Fixed by #125
Closed

Empty scenario unexpectedly produces test steps #124

davidjgoss opened this issue Aug 2, 2024 · 1 comment Β· Fixed by #125
Assignees

Comments

@davidjgoss
Copy link
Contributor

πŸ‘“ What did you see?

Given an empty scenario and no step definitions, we're seeing a TestStepStarted and TestStepFinished messages when it runs.

βœ… What did you expect to see?

Expect to see test case messages but not test step messages.

πŸ“¦ Which tool/library version are you using?

fake-cucumber 16.5.0

πŸ”¬ How could we reproduce it?

Feature: Empty Scenarios
  Scenario: Blank Scenario

And execute fake-cucumber

πŸ“š Any additional context?

See cucumber/compatibility-kit#103.

@davidjgoss
Copy link
Contributor Author

davidjgoss commented Aug 2, 2024

In makeTestCase.ts:

if (pickle.steps.length === 0) {
    const id = newId()
    const undefinedStep = new EmptyPickleTestStep(
      id,
      undefined,
      true,
      [],
      [],
      clock,
      stopwatch,
      makeErrorMessage
    )
    return new TestCase(newId(), [undefinedStep], pickle.id, clock)
  }

This explains the current behaviour. It can be removed but some other code will likely need making more defensive as a result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant