gpt4 book ai didi

postman - 在 Postman 中使用 Lodash 时出错

转载 作者:行者123 更新时间:2023-12-02 05:16:40 29 4
gpt4 key购买 nike

我在 Postman 的测试脚本中有以下代码

var _ = require('lodash');

tests["Status code is 200"] = responseCode.code === 200;
var data = JSON.parse(responseBody);

tests["Data is present"] = !!data;
var newData=environment["results"];

var diff=_.xorWith(data, newData, _.isEqual);

但是在测试中运行时给了我

Cannot find module 'lodash' Error

我该如何使用它?

谢谢

最佳答案

我找到了解决方案;这是两件事:

  1. Postman 存在错误,无法正确加载某些功能
  2. Postman 只支持 3.x 版本而不是最新的 4.x 版本,所以许多有用的功能(如 XorWith)根本不可用

谢谢大家的时间

关于postman - 在 Postman 中使用 Lodash 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38871506/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com