Skip to content

CLI: Targetting the same file multiple times seems to duplicate the results #1706

@nicojs

Description

@nicojs

Describe the bug

In order to save time, I'm trying to use cucumber-js to target individual features and examples (a lot of them). I'm using these arguments:

$ npx cucumber-js "features/foo.feature:33" "features/foo.feature:34"

(to target 2 examples)

However, instead of saving time, it just takes more time. It seems that both examples are now executed twice.

To Reproduce

  1. Follow the nodejs example: https://github.com/cucumber/cucumber-js/blob/main/docs/nodejs_example.md
  2. Execute npx cucumber-js features/simple_math.feature:19, see:
    ...
    
    1 scenario (1 passed)
    3 steps (3 passed)
    
  3. Same for line 20, npx cucumber-js features/simple_math.feature:20, see:
    ...
    
    1 scenario (1 passed)
    3 steps (3 passed)
    
  4. Now, execute npx cucumber-js features/simple_math.feature:19 features/simple_math.feature:20, see:
    ............
    
    4 scenarios (4 passed)
    12 steps (12 passed)
    

Expected behavior

...
2 scenario (2 passed)
6 steps (6 passed)

Desktop (please complete the following information):

  • OS: Windows
  • cucumberjs v7.3.0
  • npm 6.14.11, node v12.21.0

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 bugDefect / Bug✅ acceptedThe core team has agreed that it is a good idea to fix thisgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions