Reputation: 11
* def xyz = 'abc'
* def abc = {"pratyush" : '#(xyz)'}
* def editJson =
"""
function(s)
{
var x = s.x
karate.log(x)
}
"""
* def p = call editJson ({"x" :abc})
actual output -{pratyush=abc} expected output - {"pratyush":'abc'}
Upvotes: 1
Views: 43
Reputation: 4239
use pretty to print it like JSON
karate.log(karate.pretty(x))
other than that it doesn't make it as invalid JSON
* def editJson =
"""
function(s)
{
var x = s.x
return x;
}
"""
* def p = call editJson ({"x" :abc})
* print p
# {"pratyush":'abc'}
Upvotes: 1