title: Jest is green even if Expected is not equal Received
body: <pre><code>it('User is already present as a supplier', (done) =&gt; {
      const store = mockStore({}, [{ type: 'get_user', data: { } }]);
      return store.dispatch(userGetAction({ role: 'supplier' }, () =&gt; {})).then(() =&gt; {
        try {
          expect(store.getActions()[0].data.disabled).toEqual(true);
          expect(store.getActions()[0].data.errormessage).toEqual('User is already present as a assitantbuyer');
        } catch (err) {
          console.log(err);
        }
        done();
      }).catch(() =&gt; {
        done();
      });
    });
  </code></pre>
  
  <p>Why it is passing and showing green status even it is Expected is not equal to Actual.</p>
  
  <pre><code>PASS  src/actions/user-get-action-assistant-buyer.test.jsx
    ● Console
  
      console.error node_modules/fbjs/lib/warning.js:33
      console.log src/actions/user-get-action-assistant-buyer.test.jsx:25
        { Error: expect(received).toEqual(expected)
  
        Expected value to equal:
          "User is already present"
        Received:
          "User is already present"
            at store.dispatch.then (/Users/prakashchandrabarnwal/Desktop/myProductInduct_CE_Admin/src/actions/user-get-action-assistant-buyer.test.jsx:23:57)
          matcherResult: 
           { actual: 'User is already present as a assitant buyer',
             expected: 'User is already present as a assitantbuyer',
             message: [Function],
             name: 'toEqual',
             pass: false } }
  </code></pre>
  
  <p>If i do not wrap expect inside try catch its silently going inside .catch()</p>
  
  <p>thunk code returning UnhandledPromiseRejectionWarning: </p>
  
  <pre><code>const buyerAction = (data = {}, cb) =&gt; dispatch =&gt; axios({
    method: 'POST',
    url: `http://localhost:3001/api/manageUsers`,
    headers: {
      'x-access-token': authService.getAccessToken()
    },
    data
  }).then(res =&gt; new Promise((resolve, reject) =&gt; {
    if (res.status === 200 &amp;&amp; res.data) {
      dispatch({ type: 'buyer_created', data: res.data.message });
      if (data.role === 'buyer') {
        axios({
          method: 'POST',
          url: `http://localhost:3001/api/populateBuyerLookUp`,
          headers: {
            'x-access-token': authService.getAccessToken()
          },
          data
        })
  
  .then((response) =&gt; {
              resolve(response);
            }).catch((err) =&gt; {
              reject(err);
            });
          }
          cb(res.data.message);
        } else {
          reject(res);
        }
      }))
        .catch(() =&gt; {
          console.log('error');
        });
  </code></pre>
  
  <p>(node:44182) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)</p>