what is a dubious test in casperjs
Asked Answered
C

4

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?

Circumstantiate answered 13/11, 2013 at 6:33 Comment(0)
T
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.

Tousle answered 13/11, 2013 at 15:44 Comment(1)
RoshanMJ is right. Dubious is defined in modules/tester.js around line 1156. Check this: github.com/n1k0/casperjs/blob/…Madore
B
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.

Briard answered 31/7, 2014 at 6:17 Comment(0)
T
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.

Tousle answered 13/11, 2013 at 15:44 Comment(1)
RoshanMJ is right. Dubious is defined in modules/tester.js around line 1156. Check this: github.com/n1k0/casperjs/blob/…Madore
H
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.

Heard answered 29/11, 2015 at 13:39 Comment(0)
E
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(){...})
Ernaldus answered 19/8, 2016 at 2:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.