I want to use Object.assign() function in Karate, I tried use it directly, or use it in a function, but no one can work.
So I want to know:
Can karate use Object.assign?
and How to use it in Karate?
* def fn = function(target, source) {return Object.assign(target, source)}
* def result = fn(clonePagePayload, sourcePayload)
* print result
The error is
* def result = fn(clonePagePayload, sourcePayload)
js failed:
>>>>
01: fn(clonePagePayload, sourcePayload)
<<<<
org.graalvm.polyglot.PolyglotException: com.oracle.truffle.api.dsl.UnsupportedSpecializationException: Unexpected values provided for ExportValueNodeGen@1e721583: [111, JSUndefined, false], [String,Nullish,Boolean]
Please use
karate.merge()instead.Example: