title: Mocha is not retrying if failure occurs in before() or beforeEach() hooks?
body: <p>I have defined retires as 3 in <code>.mocharc.json</code> file</p>
  <pre><code>{
      &quot;retries&quot;: 3
  }
  </code></pre>
  <p>My spec file is</p>
  <pre><code>const chai = require('chai');
  const dirtyChai = require('dirty-chai');
  
  const { expect } = chai;
  
  
  chai.use(dirtyChai);
  
  describe('Database Connection', () =&gt; {
    before(() =&gt; {
      expect(false).to.be.true();
      console.log('My Before Block');
    });
    it('Local connection', async () =&gt; {
      console.log('My Test Block');
    });
  });
  </code></pre>
  <p>My expectation is, it should run for three times, as the <code>before</code> block will fail in the above code. But, i see the execution is happening only once.</p>
  <p>if the failure occurs in <code>it</code> block, then the execution is happening 3 times.</p>
  <p>Can someone explain what the issue is? I want the code to run 3 times even if there is a failure in before() or beforeEach() block.</p>
  <p>Can someone help me to achieve this?</p>