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

Upgrading of elasticsearch-mock form v1.0 to v2.0 #27

Open
ghost opened this issue Oct 3, 2022 · 1 comment
Open

Upgrading of elasticsearch-mock form v1.0 to v2.0 #27

ghost opened this issue Oct 3, 2022 · 1 comment

Comments

@ghost
Copy link

ghost commented Oct 3, 2022

Hi, I got a currentNode.createStaticChild is not a function from find-my-way after upgrading to v2.0. Can check if anyone face the same issue as me?

@joecullinbarracuda
Copy link

joecullinbarracuda commented Aug 31, 2023

Same problem here. We're upgrading from 1 to 2 also.

Only happens for mocking paths with wildcards, like path: "/my-index*/_search"

I want to mock a path with a literal asterisk, but find-my-way is interpreting the asterisk as a wildcard.

delvedor/find-my-way#277 mentions this and suggests a workaround. I'm temporarily using a similar workaround while I work through a bunch of broken tests for various other problems. (Updating from elastic 7.x to 8.x at the same time; many of my errors have nothing to do with this mock module.)

My workaround is to get rid of the wildcard in a couple places, like the add and get methods:

pattern.path = pattern.path.replace(/[*]/g, 'WILDCARD_WORKAROUND');

delvedor/find-my-way#304 might be useful too.

I'll update this comment and/or submit a PR if I come up with anything more elegant or useful.

...

Update: I tried to create a better workaround in elasticsearch-mock, but couldn't come up with anything workable. For now I'm using override in my package.json to force elasticsearch-mock to use an older version of find-my-way:

"overrides": {
    "find-my-way": "4.3.3"
}

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

1 participant