title: Test nodejs server code without running server
body: <p>New to nodejs testing.</p>
  
  <p>I have a nodejs server that runs some complex server side logic, and I'm looking at building a unit test runner for that code. I do <strong><em>not</em></strong> want to run the server and tests sending it requests though, as that doesn't expose all the modules and functions I want to test on the server side. That will be more like integration testing. I just want to import those server side files, which are written as AMD modules, and call their functions one by one in unit tests.</p>
  
  <p>What's the best way to go about doing this?</p>