首页 > 解决方案 > 如何在节点程序中直接获取 newman 的 json 报告?

问题描述

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

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

标签: node.jsnewman

解决方案


它在回调函数中。

summarycallback (err, summary)我需要的。


推荐阅读