我正在使用 Insomnia 测试 API,在其中一个响应中,密钥的名称为空。有没有办法验证该键的值?
{
"QueryId": "queryid_1",
"Succeeded": false,
"Errors": {
"": [
"The VehicleKey field is required."
]
},
"Extras": null
}
我试过了:
expect(body.Errors.''[0]).to.equal("The VehicleKey field is required.")
expect(body.Errors.""[0]).to.equal("The VehicleKey field is required.")
expect(body.Errors.key[0]).to.equal("The VehicleKey field is required.")
但没有任何效果。