title: Unit testing in the browser
body: <p>I prefer unit testing in the browser because I enjoy <a href="http://timgilbert.files.wordpress.com/2012/11/mocha-pending-specs.png" rel="nofollow">the legible formatting</a> of testing frameworks like mocha. </p>
  
  <p>Is there an easy way run add-on sdk unit tests in the browser?</p>
  
  <p>Edit: I'm not looking to do regression testing. With mocha, for example, I can create an HTML page like this:</p>
  
  <pre><code>&lt;head&gt;
    &lt;title&gt;Tests&lt;/title&gt;
    &lt;link rel="stylesheet" href="mocha.css" /&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;script src="mocha.js"&gt;&lt;/script&gt;
    &lt;script src="chai.js"&gt;&lt;/script&gt;
    &lt;script src="main-content.js"&gt;&lt;/script&gt;
    &lt;script&gt;mocha.setup('bdd')&lt;/script&gt;
    &lt;script src="main-content-test.js"&gt;&lt;/script&gt;
    &lt;script&gt;
      mocha.run();
    &lt;/script&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>The output looks like the picture I linked to above. This is what I mean by unit testing in the browser.</p>
  
  <p>Edit 2: I'm trying to unit test my modules (using require("sdk/test"), not my content scripts.</p>