src/index.js
function patchMocha() {
  const _testRun = Mocha.Test.prototype.run;

  Mocha.Test.prototype.run = function (fn) {
    function done(ctx) {
      fn.call(this, ctx);

      if (testRequests.length) {
        printTestRequest(testRequests);
        testRequests = [];
      }
    }

    return _testRun.call(this, done);
  };

  const _run = Mocha.prototype.run;

  Mocha.prototype.run = function(fn) {
    function done(failures) {
      printHostnames(hostnames);
      fn.call(this, failures);
    }

    return _run.call(this, done);
  };
}
function patchMocha() {
  const _testRun = Mocha.Test.prototype.run;

  Mocha.Test.prototype.run = function (fn) {
    function done(ctx) {
      fn.call(this, ctx);

      if (testRequests.length) {
        printTestRequest(testRequests);
        testRequests = [];
      }
    }

    return _testRun.call(this, done);
  };

  const _run = Mocha.prototype.run;

  Mocha.prototype.run = function(fn) {
    function done(failures) {
      printHostnames(hostnames);
      fn.call(this, failures);
    }

    return _run.call(this, done);
  };
}
function patchMocha ( ) { const _testRun = Mocha . Test . prototype . run ; Mocha . Test . prototype . run = function ( fn ) { function done ( ctx ) { fn . call ( this , ctx ) ; if ( testRequests . length ) { printTestRequest ( testRequests ) ; testRequests = [ ] ; } } return _testRun . call ( this , done ) ; } ; const _run = Mocha . prototype . run ; Mocha . prototype . run = function ( fn ) { function done ( failures ) { printHostnames ( hostnames ) ; fn . call ( this , failures ) ; } return _run . call ( this , done ) ; } ; }
Patch mocha to display recording requests during individual tests and at
the end of the test suite.
Patch mocha to display recording requests during individual tests and at the end of the test suite .