測(cè)試結(jié)果 (JSON)

2018-02-24 15:42 更新

測(cè)試結(jié)果 (JSON)

JavaScript 對(duì)象表示法 (JSON)是輕量級(jí)的數(shù)據(jù)交換格式。下面的例子展示了 ArrayTest 中的測(cè)試所生成的 JSON 訊息:

{"event":"suiteStart","suite":"ArrayTest","tests":2}
{"event":"test","suite":"ArrayTest",
 "test":"testNewArrayIsEmpty(ArrayTest)","status":"pass",
 "time":0.000460147858,"trace":[],"message":""}
{"event":"test","suite":"ArrayTest",
 "test":"testArrayContainsAnElement(ArrayTest)","status":"pass",
 "time":0.000422954559,"trace":[],"message":""}

以下 JSON 訊息是由名為 FailureErrorTest 的測(cè)試用例類中的兩個(gè)測(cè)試 testFailuretestError 所生成的,展示了失敗和錯(cuò)誤是如何表示的:

{"event":"suiteStart","suite":"FailureErrorTest","tests":2}
{"event":"test","suite":"FailureErrorTest",
 "test":"testFailure(FailureErrorTest)","status":"fail",
 "time":0.0082459449768066,"trace":[],
 "message":"Failed asserting that <integer:2> is equal to <integer:1>."}
{"event":"test","suite":"FailureErrorTest",
 "test":"testError(FailureErrorTest)","status":"error",
 "time":0.0083680152893066,"trace":[],"message":""}
以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)