title: Mocha-phantomjs testing no output
body: <p>I have successfully installed the node module "mocha-phantomjs" <a href="https://github.com/metaskills/mocha-phantomjs#readme" rel="nofollow">here</a>. I wrote the following test case: </p>
  
  <p>test1.js</p>
  
  <pre><code>describe("DOM Tests", function () {
      var el = document.createElement("div");
      el.id = "myDiv";
      el.innerHTML = "Hi there!";
      el.style.background = "#ccc";
      document.body.appendChild(el);
      var myEl = document.getElementById('myDiv');
      it("is in the DOM", function () {
          expect(myEl).to.equal(null);
      });
      it("is a child of the body", function () {
          expect(myEl.parentElement).to.equal(document.body);
      });
      it("has the right text", function () {
          expect(myEl.innerHTML).to.equal("Hi there!");
      });
      it("has the right background", function () {
          expect(myEl.style.background).to.equal("rgb(204, 204, 204)");
      });
  });
  </code></pre>
  
  <p>TestCase.html</p>
  
  <pre><code>&lt;html&gt;
    &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;link rel="stylesheet" href="mocha.css" /&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;div id="mocha"&gt;&lt;/div&gt;
      &lt;script src="mocha.js"&gt;&lt;/script&gt;
      &lt;script src="chai.js"&gt;&lt;/script&gt;
      &lt;script&gt;
        mocha.ui('bdd');
        mocha.reporter('html');
        expect = chai.expect;
      &lt;/script&gt;
      &lt;script src="test1.js"&gt;&lt;/script&gt;
      &lt;script&gt;
        if (window.mochaPhantomJS) { mochaPhantomJS.run(); }
        else { mocha.run(); }
      &lt;/script&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>What I'm getting is absolutely no output, even if I do a typo inside my js file. </p>
  
  <p>The main point here is I have to use some automated dom and js tests in a headless server and to integrate that with Jenkins, and I thought this using TAP reports was alright. Any other suggestions are welcome. </p>
  
  <p>EDIT</p>
  
  <p>I updated my phantomjs version and now I get the following: </p>
  
  <pre><code>TypeError: 'undefined' is not a function (evaluating 'mocha.ui('bdd')')
  
    file:///home/seventeenlive/site/tests/TestRunner2.html:11
  ReferenceError: Can't find variable: describe
  
    file:///home/seventeenlive/site/tests/test1.js:20
  ReferenceError: Can't find variable: process
  
    mocha-phantomjs/core_extensions.js:21
    mocha-phantomjs/core_extensions.js:82
  ReferenceError: Can't find variable: process
  
    phantomjs://webpage.evaluate():2
    phantomjs://webpage.evaluate():8
    phantomjs://webpage.evaluate():8
  ReferenceError: Can't find variable: process
  
    phantomjs://webpage.evaluate():3
    phantomjs://webpage.evaluate():17
    phantomjs://webpage.evaluate():17
  Failed to start mocha.
  </code></pre>