【问题标题】:Elisions are not supported error using newman to run integration tests使用 newman 运行集成测试时不支持省略错误
【发布时间】:2020-04-11 00:26:00
【问题描述】:

我正在使用 Postman 和 CLI 工具 Newman 对多个微服务运行集成测试。

我最近不得不对其进行一些重构,而我最近的测试运行从 Newman 抛出了一个错误:

> newman run Postman.postman_collection.json -e ../postman_environments/Integration.postman_environment.json --env-var authorization="$TOKEN"
error: Elisions are not supported at 25:4
        ,
         ^

我已大量搜索此错误消息,但似乎找不到任何与邮递员或纽曼有关的结果,或与任何软件模糊相关的结果。

【问题讨论】:

    标签: node.js json postman


    【解决方案1】:

    我搜索了 StackOverflow 并没有找到这个,所以我想我会回答我自己的问题。在 Google 搜索结果中翻了几页,我发现一篇 MDN 文章提到了 elisions

    {in Arrays and Objects} If more than one trailing comma is used, an elision (or hole) is produced.

    原来我在Integration.postman_environment.json 文件中多了一个逗号!据推测,此错误是由 newman 内部的 JSON.parse() 调用引发的。

    由于我在 SO 上完全找不到这个答案,所以我决定回答我自己的问题。

    【讨论】:

    • 很高兴您回答了自己的问题。
    • 哈!好吧,希望我对你或其他人有所帮助
    猜你喜欢
    • 1970-01-01
    • 2019-08-01
    • 2021-07-01
    • 2017-11-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-03-29
    • 2020-07-24
    相关资源
    最近更新 更多