Closed ckpiggy closed 7 years ago
I use multiple FAIL() or OK() in one test, and here are the logs.
FAIL()
OK()
===================== TESTING ====================== [ TEST: api-response.js ] Passed ............. err resp <expect 400 status got 400> [49 ms] Passed ............. json resp <expect data.res === "test" got test> [31 ms] Passed ............. json resp <expect 200 status got 200> [31 ms] [ TEST: events.js ] sqlagent/mongodb (490) ----- exec sqlagent/mongodb (490) ----- done (9 ms) Passed ............. create event <expect 200 status> [27 ms] Passed ............. create event <expect identity> [27 ms] ===================== RESULTS ====================== > Passed ......... 5/3 > Failed ......... 0/3
Test count is smaller than pass count.
I am not sure which is better :
planA: Move T.count++ from global.Test to logger
T.count++
global.Test
planB: If one check in a test failed, then the test failed, we should skip remain checks in the test and T.countno++. The test should pass only if all the checks in the test passed, and T.countok++.
T.countno++
T.countok++
@ckpiggy can you update it? Maybe planA will be enough. Thank you!
I use multiple
FAIL()
orOK()
in one test, and here are the logs.Test count is smaller than pass count.
I am not sure which is better :
planA: Move
T.count++
fromglobal.Test
to loggerplanB: If one check in a test failed, then the test failed, we should skip remain checks in the test and
T.countno++
. The test should pass only if all the checks in the test passed, andT.countok++
.