【问题标题】:Unexcepted failed Gavel/Dredd testGavel/Dredd 测试无一例外地失败
【发布时间】:2015-06-09 19:04:28
【问题描述】:

谁能帮我弄清楚为什么这个 Dredd 测试失败了?我觉得很好:

fail: GET /device/2/battery duration: 260ms
fail: body: Real and expected data does not match.

request: 
body: 

headers: 
    User-Agent: Dredd/0.6.0 (Darwin 14.3.0; x64)

uri: /device/2/battery
method: GET


expected: 
headers: 
    connection: Keep-Alive
    content-length: 18
    content-type: text/plain

body: 
BATTERY REQ QUEUED

statusCode: 200


actual: 
statusCode: 200
headers: 
    connection: Keep-Alive
    content-length: 18
    content-type: text/plain
    date: Tue, 09 Jun 2015 19:01:59 GMT

body: 
BATTERY REQ QUEUED

【问题讨论】:

    标签: testing automated-tests dredd


    【解决方案1】:

    这些可疑错误通常是由预期或实际正文中的尾随换行符引起的。尝试使用 CLI API Blueprint parser 解析您的蓝图,看看 Dredd 究竟期望什么。

    a hint for a workaround for this in the documentation

    【讨论】:

    • 谢谢!这是预期正文中的换行符!
    猜你喜欢
    • 1970-01-01
    • 2021-01-22
    • 2019-11-11
    • 1970-01-01
    • 1970-01-01
    • 2011-03-29
    • 2018-12-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多