code: function (afterEachDistanceFromTest) {
      return _(current().errors).map('metadata').some(function (errorMetadata) {
        return errorMetadata.isAssociatedWithATest &&
               errorMetadata.distanceFromTest <= afterEachDistanceFromTest
      })
    }
docs: This is a confusing function. The goal: we want to run an afterEach, only when at least some other function at the same depth (a beforeEach or the test function itself) also ran, to give the user a chance to clean up resources (like a `finally` block)  foo: { bar: { baz: function () {}, // test, distance 0 afterEach: function () {} // distance 0 }, afterEach: function () {} // distance 1 }  In the above example, if test 'foo bar baz' fails, it'll be at a distance less than the final afterEach, so that afterEach ought to be run.