首页 > 解决方案 > 错误 - karate.mapWithKey 不是函数

问题描述

如何处理以下空手道错误?

javascript 评估失败:karate.mapWithKey(list, 'name'), TypeError: karate.mapWithKey is not a function in at line number 1

def list = [ 'Bob', 'Wild', 'Nyan' ]
def data = karate.mapWithKey(list, 'name')
match data == [{ name: 'Bob' }, { name: 'Wild' }, { name: 'Nyan' }]

标签: karate

解决方案


您可能使用的是旧版本的空手道。升级。

如果您仍然卡住,请按照以下流程操作:https ://github.com/intuit/karate/wiki/How-to-Submit-an-Issue


推荐阅读