Skip to content

Step regexp regression in v6 when value is empty #1329

Closed
@fmagaldea

Description

@fmagaldea

Context

  • Cucumber version: 6.0.5
  • Node version: 13.1.0,
  • Operating system: macOS 10.13.3 / same on circleci image node 13.1.0

Notice

This may be an issue on cucumber-expression, but I'm not sure.

Description

With cucumber-js version 5.1.0, the regexp ([^"]*) was detected as an empty string if in the feature file it was empty.
As of version 6, it's null.

Example

  1. Let's define the step:
const {When} = require('cucumber');

When(/^The value equals "([^"]*)"$/, async function(value) {
  console.log(value);
});
  1. Let's call the step:
    The value equals ""
  2. The console output is:
    null
    whereas it should just log an empty string.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions