15

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?

M T
  • 4,099
  • 4
  • 21
  • 27

4 Answers4

30

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.

Artjom B.
  • 61,146
  • 24
  • 125
  • 222
RoshanMJ
  • 321
  • 3
  • 5
7

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.

hexid
  • 3,811
  • 1
  • 30
  • 40
  • 2
    RoshanMJ is right. Dubious is defined in modules/tester.js around line 1156. Check this: https://github.com/n1k0/casperjs/blob/4afe11024a23183cb33a4d95f803873b8898c951/modules/tester.js – Alexei Danchenkov Aug 17 '14 at 05:06
1

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.

Domeniconi
  • 11
  • 1
1

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(){...})
Huy Nguyen
  • 2,025
  • 3
  • 25
  • 37