【发布时间】:2019-11-06 18:18:36
【问题描述】:
我正在尝试在我的 test1.js 中使用它:
const newman = require('newman'); // require newman in your project
// call newman.run to pass `options` object and wait for callback
newman.run({
collection: require('./postman/poc_collection.json')
environment: require('./postman/poc_env.json'),
exportGlobals: require('./postman/poc_globals.json'),
reporters: 'cli'
}, function (err) {
if (err) { throw err; }
console.log('collection run complete!');
});
运行完成后,将生成文件 newman-globals-2019-01-11-14-39-00-154-0.json 而不是使用 poc_globals.json 上面指定的文件。
newman 命令行中的 --export-globals 选项可以正常工作。
我错过了什么?
谢谢, 拉姆亚
【问题讨论】:
-
您从哪里获得该属性名称?