title: JavaScript unit testing best practices
body: <p>This may be a broad and controversial question... but here we go.</p>
  <p>I have never done unit testing in JavaScript before and I'd like to know what the best practice is with regards to its deployment.</p>
  <p>Unit testing itself is quite straightforward (it's simple to create my own unit test or use existing frameworks such as QUnit).</p>
  <p>My question is around deployment best practice; should unit test code be deployed into production?</p>
  <p>For example: I have an object 'person' with the function 'getname()'; then I have the corresponding unit test for this to assert that the name is what I expect.</p>
  <p>Quite simple, right?... but I have never seen an example of a JavaScript unit test &quot;in the wild&quot;. So when people deploy their work into productions environments:</p>
  <ul>
  <li>Are they stripping the unit tests to save on bandwidth?</li>
  <li>Is there a particular way to handle unit test so that they don’t go into production?</li>
  <li>Is there a tool available that will enable me to unit test locally, but strip it for production?</li>
  </ul>
  <p>I've never unit tested JavaScript before, so I'm not sure I'm asking the right question.</p>