ZaDarkSide / js-test-driver

Automatically exported from code.google.com/p/js-test-driver
0 stars 0 forks source link

Mockito verify fail causes no tests to run #348

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create mock object.  Write a test using verify(yourmock).callsYourFunction();
2.Run your tests.
3.See no error messages, and the report states that 0 tests ran, 0 failed, etc.

What is the expected output? What do you see instead?
Total 323 tests (Passed: 322; Fails: 0; Errors: 1) (180.00 ms)
  Chrome 17.0.963.78 Linux: Run 323 tests (Passed: 322; Fails: 0; Errors 1) (180.00 ms)
    MyAwesomeTest.testVerifyStuff error (0.00 ms): ["Wanted but not invoked: obj.submitOrder(<anything>, <anything>)"]

What version of the product are you using? On what operating system?
1.3.4.b

Please provide any additional information below.
Also, updated to the latest version of hamcrest/mockito.

Original issue reported on code.google.com by jeramie....@gmail.com on 14 Mar 2012 at 4:46

GoogleCodeExporter commented 8 years ago
First, mockito does js? 
Second, what does mockito throw on failure?

Original comment by corbinrs...@gmail.com on 14 Mar 2012 at 5:03

GoogleCodeExporter commented 8 years ago
First: Yes; http://jsmockito.org/

Second: the verify functionality for their mocks will throw something along the 
lines of: "Wanted but not invoked: obj.submitOrder(<anything>, <anything>)", 
where I've mocked out obj.  In my test I am running 
verify(obj).submitOrder(anything(), anything()).   Normally, with jstestDriver 
1.3.2, if that function has not been called, verify will spit out the error 
"Wanted but not invoked: obj.submitOrder(<anything>, <anything>)".  When I try 
doing this same operation with 1.3.4.b, all test running seems to halt with no 
output besides:

Total 0 tests (Passed: 0; Fails: 0; Errors: 0) (180.00 ms).

If i fix my test (doing TDD), then I get the usual:
......................................................................
......................................................................
......................................................................
......................................................................
.............................................
Total 325 tests (Passed: 325; Fails: 0; Errors: 0) (776.00 ms)
  Chrome 17.0.963.78 Linux: Run 325 tests (Passed: 325; Fails: 0; Errors 0) (776.00 ms)

Does that help?

Original comment by jeramie....@gmail.com on 14 Mar 2012 at 6:33