Question

I have recently adopted the Dojo Toolkit as my first JavaScript library, and am at the threshold of technical debt where I need to begin testing. I first looked into the Dojo Object Harness (DOH) unit test framework, and have learned the most by looking into the practice test cases in the dojo toolkit source:

 common/dojo/util/doh/tests
 common/dojo/dijit/tests

however, even with these examples, I cannot get around an error that I believe is a bug in the DOH source code. this is my error:

1 tests to run in 1 groups
------------------------------------------------------------
GROUP "tests.testSomeDialog" has 1 test to run
    Error: test timeout in ../../../../net/js/tests/test_SomeDialog.html
    ERROR IN:
         function (){
                // FIXME: implement calling into the url's groups here!!
                return this.d;
            }
FAILED test: ../../../../net/js/tests/test_SomeDialog.html 15003 ms
WOOHOO!!
------------------------------------------------------------
| TEST SUMMARY:
------------------------------------------------------------
     1 tests in 1 groups
     1 errors
     0 failures

I have been unable to resolve this 'test timeout' error because the tutorials are [at least partially] out of date, and the community seems small. QUESTION 1: Has anyone been faced with this 'test timeout' error?

I have also seen that SitePen has recently changed to a new testing framework, which would explain a lot of my problems: http://www.sitepen.com/blog/2013/05/01/intern-javascript-testing/

Était-ce utile?

La solution

To answer part 2 of your question, we use it in production quality web applications, and several large enterprises are already using it in their application testing as well. Yes, it's new, but it is built on top of established technology.

Autres conseils

I spent good amount of time looking for a solution to this problem. Let me share what I found eventhough this question is somewhat old. I wasn't able to find an answer anywhere else.

Apparently, this was a minor overlook. In my case I had something like this:

    registerTests : function(){
        doh.register("dohTest", [
            function firstTest() {
                 doh.assertEqual("test", "test");
            }       
        ]);
        doh.run();
    }

Then nowhere in the code registerTests() was getting invoked. So, if you are getting this error, most likely the function where you have your test is not getting invoked.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top