Skip to content

CodeceptJS 4.x - Regex-format steps are no longer supported as valid input #5359

@nlespiaucq

Description

@nlespiaucq

🚩 [4.0.1-beta.23]

Until now (ie: 3.x), the step definition supports 3 formats:

  • regular string,
  • cucumber expression,
  • regex

Cf: https://codecept.io/bdd/#gherkin
However, it's no longer the case with the version 4.x

Impacts

It's a breaking changes causing errors in the IDE, and blocking PR checks (if exists) when trying to validate contracts.

How to reproduce:

  • Clone: git clone git@github.com:nlespiaucq/examples-ts.git
  • Checkout the 4.x branch: git checkout 4.x
  • Install everything
cd codeceptjs-examples-ts
npm install
npx playwright install
  • Run validation script: npx tsc --noEmit --skipLibCheck

Current result

todomvc-tests/step-definitions/create-todos.steps.ts:9:6 - error TS2345: Argument of type 'RegExp' is not assignable to parameter of type 'string'.

9 When(/I create a todo (\d+)/, (todo) => {
~~~~~~~~~~~~~~~~~~~~~~~
Found 1 error in todomvc-tests/step-definitions/create-todos.steps.ts:9

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions