title: Node.js mocha testing: AssertionError: expected true to be false
body: <p>I wrote a mocha script for testing <code>Email not found</code> case. Here is the code:  </p>
  
  <pre><code>    it('Returns "Email not found"', function(done) {
  
      userModelMock.seedUsers();
      var testUser = userModelMock.getTestUser(),
          nonExistentEmailAddress = 'dummy@email.com';
  
      controller.resetPassword(nonExistentEmailAddress, function(err, apiResponse) {
  
          if (err) return done(err);
          should(apiResponse.success).equal(false);
          should(apiResponse.extras.msg)
              .equal(ApiMessages.EMAIL_NOT_FOUND);
          done();
      })
  });  
  </code></pre>
  
  <p>I got this error when I ran <code>mocha</code> in terminal:</p>
  
  <pre><code> 1)  Returns "Email not found":
  
       AssertionError: expected true to be false
       + expected - actual
  
       -true
       +false
  
       at Assertion.fail (D:\PhoneGap_Projects\login\www\server\node_modules\should\lib\assertion.js:92:17)
       at Assertion.Object.defineProperty.value (D:\PhoneGap_Projects\login\www\server\node_modules\should\lib\assertion.js:164:1
       at D:\PhoneGap_Projects\login\www\server\test\account-controller-test.js:211:37
       at D:\PhoneGap_Projects\login\www\server\controllers\account.js:186:16
       at UserMock.findOne (D:\PhoneGap_Projects\login\www\server\test\user-mock.js:65:12)
       at AccountController.resetPassword (D:\PhoneGap_Projects\login\www\server\controllers\account.js:166:18)
       at Context.&lt;anonymous&gt; (D:\PhoneGap_Projects\login\www\server\test\account-controller-test.js:208:16)
       at callFnAsync (C:\Users\Ajay Kulkarni-enEXL\AppData\Roaming\npm\node_modules\mocha\lib\runnable.js:338:8)
       at Test.Runnable.run (C:\Users\Ajay Kulkarni-enEXL\AppData\Roaming\npm\node_modules\mocha\lib\runnable.js:290:7)
       at Runner.runTest (C:\Users\Ajay Kulkarni-enEXL\AppData\Roaming\npm\node_modules\mocha\lib\runner.js:422:10)
       at C:\Users\Ajay Kulkarni-enEXL\AppData\Roaming\npm\node_modules\mocha\lib\runner.js:533:12
       at next (C:\Users\Ajay Kulkarni-enEXL\AppData\Roaming\npm\node_modules\mocha\lib\runner.js:342:14)
       at C:\Users\Ajay Kulkarni-enEXL\AppData\Roaming\npm\node_modules\mocha\lib\runner.js:352:7
       at next (C:\Users\Ajay Kulkarni-enEXL\AppData\Roaming\npm\node_modules\mocha\lib\runner.js:284:14)
       at C:\Users\Ajay Kulkarni-enEXL\AppData\Roaming\npm\node_modules\mocha\lib\runner.js:315:7
       at done (C:\Users\Ajay Kulkarni-enEXL\AppData\Roaming\npm\node_modules\mocha\lib\runnable.js:276:5)
       at C:\Users\Ajay Kulkarni-enEXL\AppData\Roaming\npm\node_modules\mocha\lib\runnable.js:349:7
       at Context.&lt;anonymous&gt; (D:\PhoneGap_Projects\login\www\server\test\account-controller-test.js:25:5)
       at callFnAsync (C:\Users\Ajay Kulkarni-enEXL\AppData\Roaming\npm\node_modules\mocha\lib\runnable.js:338:8)
       at Hook.Runnable.run (C:\Users\Ajay Kulkarni-enEXL\AppData\Roaming\npm\node_modules\mocha\lib\runnable.js:290:7)
       at next (C:\Users\Ajay Kulkarni-enEXL\AppData\Roaming\npm\node_modules\mocha\lib\runner.js:298:10)
       at Immediate._onImmediate (C:\Users\Ajay Kulkarni-enEXL\AppData\Roaming\npm\node_modules\mocha\lib\runner.js:320:5)  
  </code></pre>
  
  <p>That error is happening in the following lines:  </p>
  
  <pre><code>if (err) return done(err);
          should(apiResponse.success).equal(false);
          should(apiResponse.extras.msg)
              .equal(ApiMessages.EMAIL_NOT_FOUND);
          done();  
  </code></pre>
  
  <p>How can I fix that error? </p>