docs: function TAP(runner, options) {
    Base.call(this, runner, options);
  
    var self = this;
    var n = 1;
  
    var tapVersion = '12';
    if (options && options.reporterOptions) {
      if (options.reporterOptions.tapVersion) {
        tapVersion = options.reporterOptions.tapVersion.toString();
      }
    }
  
    this._producer = createProducer(tapVersion);
  
    runner.once(EVENT_RUN_BEGIN, function() {
      var ntests = runner.grepTotal(runner.suite);
      self._producer.writeVersion();
      self._producer.writePlan(ntests);
    });
  
    runner.on(EVENT_TEST_END, function() {
      ++n;
    });
  
    runner.on(EVENT_TEST_PENDING, function(test) {
      self._producer.writePending(n, test);
    });
  
    runner.on(EVENT_TEST_PASS, function(test) {
      self._producer.writePass(n, test);
    });
  
    runner.on(EVENT_TEST_FAIL, function(test, err) {
      self._producer.writeFail(n, test, err);
    });
  
    runner.once(EVENT_RUN_END, function() {
      self._producer.writeEpilogue(runner.stats);
    });
  }