title: Test-driven development of JavaScript web frontends
body: <p>This might sound a little dumb, but I'm actually a bit confused how to approach JavaScript testing for web frontends. As far as I'm concerned, the typical 3-tier architecture looks like this:</p>
  
  <ol>
  <li>Database tier</li>
  <li>Application tier</li>
  <li>Client tier</li>
  </ol>
  
  <p>1 is of no concern in this question. 2 contains all the program logic ("business logic") 3 the frontend.</p>
  
  <p>I do test-driven development for most projects, but only for the application logic, not the frontend. That is because testing the UI is difficult and unusual in TDD, and normally not done. Instead, all application logic is separated from UI, so that it is simple to test that logic.</p>
  
  <p>The three tier architecture supports this: I can design my backend as a REST API which is called by my frontend. How does JS testing fit in? For the typical three-tier-architecture, JS (i.e. JS on the client) testing doesn't make much sense, does it?</p>
  
  <p><strong>Update:</strong>
  I've changed the question's wording from "Testing JavaScript in web frontends" to "Test-driven development of JavaScript web frontends" to clarify my question.</p>