Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is a dubious test in casperjs

Tags:

casperjs

When running a test getting.

FAIL 35 tests executed in 16.806s, 35 passed, 0 failed, 2 dubious, 0 skipped. 

What does the 'dubious' imply and how to see which assertion or test case is dubious?

like image 476
M T Avatar asked Nov 13 '13 06:11

M T


4 Answers

Dubious tests occurs when there is mismatch in the number of tests (x) passed as argument to Casperjs test instance casper.test.begin('sometest',x,function(){...}) and the number of actual tests in the file.

In essence, the number of planned tests (x) should be equal to the number of executed tests.

like image 150
RoshanMJ Avatar answered Nov 10 '22 19:11

RoshanMJ


I believe that the dubious tests are those that aren't run because of failed tests.

So if the test case tried to exit after a failed test, but there were still 2 tests that were meant to be run after it, those 2 tests would be considered dubious.

Afaik, there is no way to see which tests are dubious because CasperJS just uses the number of passed/failed tests out of the specified number of tests to get that number.

You shouldn't consider a dubious test as either a pass or as a fail because there is no way to know which way the test would have gone.

like image 30
hexid Avatar answered Nov 10 '22 19:11

hexid


In your tests, change the 'X' (see below) to the number of assertions you have inside it and then you will see no more debiuous

casper.test.begin('sometest',X,function(){...})

This worked for me.

like image 1
Domeniconi Avatar answered Nov 10 '22 18:11

Domeniconi


The answer of @RoshanMJ is correct, however, each time we create new assertions, we have to update X number.

I just remove the X parameter in casper.test.begin('sometest',X,function(){...}) and it will work, like this:

casper.test.begin('sometest',function(){...})
like image 1
Huy Nguyen Avatar answered Nov 10 '22 18:11

Huy Nguyen