<commit_before>/* global describe, it, context, beforeEach */
'use strict';

if (typeof module !== 'undefined') {
  var chai = require('chai');
  var expect = chai.expect;
  
  var debug = require('../src/index');
  var sinon = require('sinon');
  var sinonChai = require("sinon-chai");
  chai.use(sinonChai);
}


describe('debug', function () {
  var log = debug('test');
  
  log.log = sinon.stub();
  
  it('passes a basic sanity check', function () {
    expect(log('hello world')).to.not.throw;
  });

  context('with log function', function () {
        
    beforeEach(function () {
      debug.enable('test');
      log = debug('test');
    });
  
    it('uses it', function () {
      log.log = sinon.stub();
      log('using custom log function');

      expect(log.log).to.have.been.calledOnce;
    });
  });
});
<commit_msg>fix: merged again, because it didn't take. Guess I did it wrong?<commit_after>/* global describe, it, context, beforeEach */
'use strict';

if (typeof module !== 'undefined') {
  var chai = require('chai');
  var expect = chai.expect;
  
  var debug = require('../src/index');
  var sinon = require('sinon');
  var sinonChai = require("sinon-chai");
  chai.use(sinonChai);
}


describe('debug', function () {
  var log = debug('test');
  
  log.log = sinon.stub();
  
  it('passes a basic sanity check', function () {
    expect(log('hello world')).to.not.throw;
  });

  context('with log function', function () {
        
    beforeEach(function () {
      debug.enable('test');
      log = debug('test');
    });
  
    it('uses it', function () {
      log.log = sinon.stub();
      log('using custom log function');

      expect(log.log).to.have.been.calledOnce;
    });
  });

});

{'fraction_non_alphanumeric': 0.18619489559164734, 'fraction_numerical': 0.0, 'mean_word_length': 2.956422018348624, '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': '723022', 'n_tokens_mistral': 580, 'n_tokens_neox': 572, 'n_words': 133}