DOH is a javascript unit test framework for dojo.
It provides support for asynchrounus test, visual tests, has a robot to automate UI tests and other features.
Tests are organized in test modules, each test module is a single javascript file. For Example :

MyTests.js
define(["doh/runner"], function(doh){
    doh.register("MyTests", [     
      { name: "test one",
        setUp: function(){...},
        runTest: function(){...},
        tearDown: function(){...}
      },
      { name: "test two",
        setUp: function(){...},
        runTest: function(){...},
        tearDown: function(){...}
      },
      { name: "test three",
        setUp: function(){...},
        runTest: function(){...},
        tearDown: function(){...}
      },
  ]);
});

What I was allways missing is something comparable to @Ignore for JUnit tests, that will ommit a single testmethod from excution. What you can do with DOH, is rename the runTest method of one test for example

...
{ name: "test two",
  setUp: function(){...},
  ignoreRunTest: function(){...},
  tearDown: function(){...}
},
...

In that case ignoreRunTest will not be executed and also its 'setUp' and 'tearDown' will be ignored. Additionally all following tests like 'test three' will also be ignored.
This can be helpfull, if you have to run a test again and again when you are hunting a bug.

Comments

comments powered by Disqus