<commit_before>'use strict';

var expect = require('expect');

var logger = require('../');

describe('gulplog', function () {
  after(function (done) {
    logger.remove();
    done();
  });

  it('should emit the appropriate event when debug/info/warn/error methods are called', function (done) {
    var called = { debug: 0, info: 0, warn: 0, error: 0 };
    function allDone() {
      if (called.debug && called.info && called.warn && called.error) {
        expect(called.debug).toEqual(1);
        expect(called.info).toEqual(1);
        expect(called.warn).toEqual(1);
        expect(called.error).toEqual(1);
        done();
      }
    }

    logger.on('debug', function (msg) {
      expect(msg).toEqual('The MOST verbose!');
      called.debug++;
      allDone();
    });

    logger.on('info', function (msg) {
      expect(msg).toEqual('Some important info');
      called.info++;
      allDone();
    });
<commit_msg>chore: Cleanup listeners after each test<commit_after>'use strict';

var expect = require('expect');

var logger = require('../');

describe('gulplog', function () {
  after(function (done) {
    logger.remove();
    done();
  });

  afterEach(function (done) {
    logger.removeAllListeners();
    done();
  });

  it('should emit the appropriate event when debug/info/warn/error methods are called', function (done) {
    var called = { debug: 0, info: 0, warn: 0, error: 0 };
    function allDone() {
      if (called.debug && called.info && called.warn && called.error) {
        expect(called.debug).toEqual(1);
        expect(called.info).toEqual(1);
        expect(called.warn).toEqual(1);
        expect(called.error).toEqual(1);
        done();
      }
    }

    logger.on('debug', function (msg) {
      expect(msg).toEqual('The MOST verbose!');
      called.debug++;
      allDone();
    });

    logger.on('info', function (msg) {
      expect(msg).toEqual('Some important info');
      called.info++;
      allDone();
    });

{'fraction_non_alphanumeric': 0.1750380517503805, 'fraction_numerical': 0.008117706747843734, 'mean_word_length': 2.806949806949807, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4388630', 'n_tokens_mistral': 609, 'n_tokens_neox': 602, 'n_words': 137}