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
Karate v1.3.x regression: karate.keysOf(), karate.valuesOf(), and karate.filterKeys() behave incorrectly within a JavaScript function #2224
Comments
When using these methods from within a JavaScript function in Karate v1.3.1, [
"get",
"values",
"clear",
"replaceAll",
"entrySet",
"forEach",
"keySet",
"containsValue",
"getOrDefault",
"remove",
"put",
"clone",
"isEmpty",
"replace",
"size",
"merge",
"putAll",
"putIfAbsent",
"compute",
"containsKey",
"computeIfAbsent",
"computeIfPresent",
"equals",
"toString",
"hashCode"
] and [
"java.util.LinkedHashMap.get",
"java.util.LinkedHashMap.values",
"java.util.LinkedHashMap.clear",
"java.util.LinkedHashMap.replaceAll",
"java.util.LinkedHashMap.entrySet",
"java.util.LinkedHashMap.forEach",
"java.util.LinkedHashMap.keySet",
"java.util.LinkedHashMap.containsValue",
"java.util.LinkedHashMap.getOrDefault",
"java.util.LinkedHashMap.remove",
"java.util.LinkedHashMap.put",
"java.util.LinkedHashMap.clone",
"java.util.LinkedHashMap.isEmpty",
"java.util.LinkedHashMap.replace",
"java.util.LinkedHashMap.size",
"java.util.LinkedHashMap.merge",
"java.util.LinkedHashMap.putAll",
"java.util.LinkedHashMap.putIfAbsent",
"java.util.LinkedHashMap.compute",
"java.util.LinkedHashMap.containsKey",
"java.util.LinkedHashMap.computeIfAbsent",
"java.util.LinkedHashMap.computeIfPresent",
"java.util.LinkedHashMap.equals",
"java.util.LinkedHashMap.toString",
"java.util.LinkedHashMap.hashCode"
] |
I suspect that the problem is not these functions, but is the fact that we are receiving a |
possible similar issue reported here: https://stackoverflow.com/q/75008620/143475 |
@nathanchilton fixed. do see if you can test by building locally |
as a note for anyone coming across this in future, the pure JS equivalents such as |
@nathanchilton 1.4.0.RC3 has been released, please try it and let us know |
@ptrthomas Thank you! I will take a look and confirm that it is working. |
@ptrthomas I just tested with |
@nathanchilton great, thanks for the feedback ! |
I'll re-open this, as the process we follow is it is |
Description
We are attempting to upgrade from Karate v1.1.0 to v1.3.1, but one more thing is holding me back:
In Karate v1.1.0 and v1.2.0, the behavior of these methods inside a JavaScript function would match the behavior in a basic Karate step, but this is not the case with Karate v1.3.1.
The attached tests will pass with Karate v1.1.0 and v1.2.0, but will fail with v1.3.1.
The 4th scenario will always pass, because it does not contain any assertions. It just makes it easy to see the difference in behavior by logging the output of these different ways of calling
karate.keysOf()
,karate.valuesOf()
, andkarate.filterKeys()
.Note:
My original example was more complicated, but as I have worked with this more, I see that the problem is even easier to demonstrate and is a bigger problem for us than I originally realized.
Scenarios for demonstration of problem
The text was updated successfully, but these errors were encountered: