node.js - Postman Newman 使用node.js时如何配置 "options"

标签 node.js rest testing postman newman

我已经创建了一个简单的 newman reast api 测试调用,我还想为我的调用使用一些选项。

const newman = require('newman');
console.log("hello");

newman.run({
    collection: 'https://www.getpostman.com/collections/4a6098a183ea90b7d8d7',
    reporters: ['cli', 'html'],
    options:'-k' //<--- *** This does not work ***
}, process.exit);

我的情况是我使用的选项是 -k(禁用 SSL 验证检查并允许自签名 SSL 证书。),我的问题通常是如何在 node.js 中使用 newman 时配置选项?

最佳答案

postman newman api 引用:https://www.npmjs.com/package/newman#api-reference

newman.run({
    collection: 'https://www.getpostman.com/collections/4a6098a183ea90b7d8d7',
    reporters: ['cli', 'html'],
    insecure:'true' //<--- will set option -k
}, process.exit);

关于node.js - Postman Newman 使用node.js时如何配置 "options",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55005711/

相关文章:

apache - PHP RESTful 服务器的 mod_rewrite

testing - 从用户的角度自动测试网站?

c# - WCF 测试客户端中的 Async() 方法

c# - Azure 文本到语音 API : New languages not available, 了吗?

java - 使用 Perl 将 Post 参数传递给 Restful Java API 时出现问题

android - 在 Cloud monkey 中检测 APK 失败

javascript - Nestjs/cqrs - 类型错误 : Cannot read property 'values' of undefined on install

node.js - mongodb 文档中子对象中的 _id(使用 Mongoose)

node.js - Azure AD - 检查安全组成员身份 -(Node.js、passport、Azure Web App)

node.js - 单例继承错误行为