title: Functional tests for a nodejs server which uses third party saas services oauthentication
body: <p>I have written <a href="https://npmjs.org/package/unifile" rel="nofollow">this module in node js</a>, which is an express middleware and will enable your node app with an API for accessing cloud storage services such as dropbox.</p>
  
  <p>For example this will list the available services</p>
  
  <pre><code>wget http://localhost:6805/api/v1.0/services/list/
  </code></pre>
  
  <p>And this will list a directory of the user Dropbox </p>
  
  <pre><code>wget http://localhost:6805/api/v1.0/dropbox/exec/ls/path/to/folder/
  </code></pre>
  
  <p>Of course, the user must have connected his Dropbox account to the app. To do so, your app must call this</p>
  
  <pre><code>wget http://localhost:6805/api/v1.0/dropbox/connect/
  </code></pre>
  
  <p>Which returns an URL, which you will open to let the user authorize the access to the service (this is an oauth2 authorization mechanism). Then call this to finish the auth process</p>
  
  <pre><code>wget http://localhost:6805/api/v1.0/dropbox/login/
  </code></pre>
  
  <p>My question is : how to test the API? I mean functionnal tests. I could mock each service (Dropbox for example) but it may be a lot of work don't you think?</p>