title: How to test runtime arguments via mocha?
body: <p>I am using mocha to test some code that I'm writing in node.js. </p>
  
  <p>One of my programs is designed to run from the command line with runtime arguments. As several of the options are directories, the code validates the options and determines if the directories exist, including an optional base directory.</p>
  
  <p>This is something I would like to test with mocha, however the code isn't designed to be imported, as it's designed to run from the command line.</p>
  
  <p>So my question is, how do I test command line arguments for a program via mocha? </p>
  
  <p>I've tried googling, but alas I keep getting articles about mocha that mention mocha's command lines, not how to test command lines for node.js code.</p>