isaacs / minimatch

a glob matcher in javascript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

3.0.7 breaks cucumberJS step definitions

ealmiladi opened this issue · comments

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.

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?

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

Oh, no such luck.

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

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

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

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

image

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

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

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

Worked perfectly, thank you.