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

3.0.7 breaks cucumberJS step definitions #156

Closed
ealmiladi opened this issue Feb 14, 2022 · 9 comments
Closed

3.0.7 breaks cucumberJS step definitions #156

ealmiladi opened this issue Feb 14, 2022 · 9 comments

Comments

@ealmiladi
Copy link

ealmiladi commented Feb 14, 2022

3.0.7 that was released two days ago broke our CucumberJS integration at our company. While we're not exactly sure what might be broken, all of our cucumber step definitions are resolving as undefined.

E.g.

import { Given } from '@cucumber/cucumber';

Given('I have {int} cucumbers in my belly', function (cucumberCount) {
  assert.equal(this.responseStatus, cucumberCount)
});

When attaching the step definitions to the cucumber CLI runner and executing a test, the test runner is no longer recognizing these step definitions on v 3.0.7.

We had to pin 3.0.4 under the resolutions block of package.json in order to circumvent >3.0.7 and resolve the issue. Many of our dependencies rely on subdependencies that include this project and are now resolving to the 3.0.7 release which includes either a bug or breaking changes.

@isaacs
Copy link
Owner

isaacs commented Feb 15, 2022

As you have a workaround, and the only solution is to roll back a security fix (since pinning won't pin your deps anyway) I'd like to investigate what's happening here.

Do you have a repro you can share?

@isaacs
Copy link
Owner

isaacs commented Feb 15, 2022

Oh I think I might know what it is, actually.

@isaacs
Copy link
Owner

isaacs commented Feb 15, 2022

Oh, no such luck.

Ok, I need a reproduction case. Nothing changed that should've caused this, so I'm stumped.

@isaacs
Copy link
Owner

isaacs commented Feb 15, 2022

This is the entirety of the functional changes from 3.0.4 to 3.0.7 https://gist.github.com/isaacs/ea62d80f51eed1b6eeae37baeef2ff38

@ealmiladi
Copy link
Author

Thanks for looking. We've created a repro and left instructions to reproduce on the README: https://github.com/ealmiladi/cucumber-js-minimatch

@ealmiladi
Copy link
Author

ealmiladi commented Feb 15, 2022

I've isolated the change that is causing our issues:

image

Including pattern = pattern.trim() fixes the issue.

@isaacs
Copy link
Owner

isaacs commented Feb 15, 2022

Aha, I see, so it looks like the pattern.trim() went missing, and that's what broke it. Easy enough to fix. Stand by.

isaacs added a commit that referenced this issue Feb 15, 2022
Overlooked that went missing at some point.

Fix: #156
isaacs added a commit that referenced this issue Feb 15, 2022
Overlooked that went missing at some point.

Fix: #156
@isaacs
Copy link
Owner

isaacs commented Feb 15, 2022

Should be fixed on 3.0 and 3.1 now. Care to test?

@isaacs isaacs closed this as completed Feb 15, 2022
@ealmiladi
Copy link
Author

Worked perfectly, thank you.

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

No branches or pull requests

2 participants