如何直接在节点程序中获取newman的json报告?

问题描述

我发现newman的文档仅描述了有关将报告输出到CLI或文件的描述。当我在node.js中使用newman库时,是否可以直接获取报告json?

    newman.run({
        collection: new Collection(collection),reporter: ['json'] // Can I insert a callback function receiving json report here?
    },err => {
        // ...
    });

解决方法

它在回调函数中。

我需要summary中的

callback (err,summary)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...