A quick fork later and I now have JsUnit 1.3-db. So far, this fork adds:
* Callstack reporting for errors and failures
* Text test result output, not just XML
* File and line numbers in all error messages
* Upgraded Rhino
Previously, if you hit an error, you'd get this:
[INFO] [jsunit2:jsunit-test {execution: test}]Then, you'd have to dig into the
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
target/surefire-reports/TEST-MyTestCase.xml
to find this:<testcase name="TestFieldTest.testRender" time="0.006">Not helpful. Now, you get this:
<error message="ReferenceError: "bar" is not defined." type=""/>
</testcase>
[INFO] [jsunit2:jsunit-test {execution: test}]For fellow Maven folks, you can find the releases at my repo:
TestRunner (1 test cases available)
> Starting test suite "TextFieldTest"
- Running test 1: "TextFieldTest.testRender"
ERROR in TextFieldTest.testRender: ReferenceError: "bar" is not defined. (TextField.js:7)
Stack trace:
1: TextField.js:7
2: TextFieldTest.js:6 (TextFieldTest_testRender)
3: JsUnit.js:827 (TestCase_runTest)
4: JsUnit.js:808 (TestCase_runBare)
5: JsUnit.js:386
6: JsUnit.js:409 (TestResult_runProtected)
7: JsUnit.js:390 (TestResult_run)
8: JsUnit.js:797 (TestCase_run)
9: JsUnit.js:1033 (TestSuite_runTest)
10: JsUnit.js:1014 (TestSuite_run)
11: JsUnit.js:2614 (EmbeddedTextTestRunner_run)
12: Components:4
< Completed test suite "TextFieldTest"
1 error, 0 failures.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
http://twdata-m2-repository.googlecode.com/svn/de/berlios/jsunit/jsunit-maven2-plugin
Did you see the test runner that Shaoting cooked up for JavaScript tests?
ReplyDeletehttp://blogs.atlassian.com/developer/2009/09/run_your_jsunit_tests_as_normal_junit4_tests.html
With this you can run them directly in your IDE using its built in JUnit support.
Nice, we should fold that back into jsunit. It would be nice to get the surefire integration it provides without all the setup that is needed currently with his solution. Since his uses jsunit, I'm guessing it shares the same issues as I found wrt poor error reporting and the lack of call stack reports.
ReplyDeleteyou have a nice site.thanks for sharing this site. various kinds of ebooks are available here
ReplyDeletehttp://feboook.blogspot.com
The best recommendation you could make about the Oakley Crosshair sunglasses is the fact that some pilots insist on wearing them during flights, and obviously having unimpaired vision is fake oakley sunglasses important to them. This means that if this brand of sunglasses is considered good enough for a pilot, then they are likely to be able to do the job for just about anyone. Recommendations from those that wear the product are very important, so when you are thinking about getting a new set of sunglasses, bear this in mind.There are many reasons why consumers choose to buy branded products and aside from looking cool, knowing that the products are usually built to last is one very good reason.
ReplyDeletevery useful codes, java script makes website more beautiful and attractive.. please share more codes like this
ReplyDelete