title: Testing using hapijs/lab -- done is not a function
body: <p>Trying to write some tests for my hapi server. The following code is from <a href="https://github.com/hapijs/lab/issues/79" rel="nofollow noreferrer">https://github.com/hapijs/lab/issues/79</a> , but it's failing because done is not a function...</p>
  
  <pre><code>const Code = require('code');
  const Lab = require('lab');
  const lab = exports.lab = Lab.script();
  lab.test('expect an error from a promise', (done) =&gt; {
      return new Promise((resolve, reject) =&gt; {
  
          try {
              resolve(2);
          }
          catch (err) {
              reject(err);
          }
      }).then((result) =&gt; {
  
          console.log('5) resolved');
          done(new Error('promise should be rejected and caught'));
      }).catch((error) =&gt; {
  
          console.log('5) rejected, this does not trigger');
          Code.expect(error).to.exist();
          done(error);
      });
  });
  </code></pre>
  
  <p>What else should I import to be able to call done?</p>
  
  <pre><code>Failed tests:
  
    1) expect an error from a promise:
  
        done is not a function
  </code></pre>