<commit_before>describe('console', function () {
  var app;

  beforeEach(function (done) {
    app = createTestApp({}, done);
  });

  afterEach(function (done) {
    app.destroy(done);
  });

  it('can replace console.log', function (done) {
    app.on('log:store', function testStore () {
      return {
        add: function (obj) {
          app.log.restoreConsole();
          assert.equal(obj.level, 'info');
          assert.equal(obj.type, 'console.log');
          done();
        }
      };
    });

    require('../');
    app.log.replaceConsole();

    app.init(function (err) {
      assert.ifError(err);
      console.log('console.log');
    });
  });

  it('can replace console.info', function (done) {
    app.on('log:store', function testStore () {
      return {
        add: function (obj) {
          app.log.restoreConsole();
          assert.equal(obj.level, 'info');
          assert.equal(obj.type, 'console.info');
          done();
        }
      };
    });

    require('../');
    app.log.replaceConsole();

    app.init(function (err) {
      assert.ifError(err);
      console.info('console.info');
    });
  });

  it('can replace console.warn', function (done) {
    app.on('log:store', function testStore () {
      return {
        add: function (obj) {
          app.log.restoreConsole();
          assert.equal(obj.level, 'warn');
          assert.equal(obj.type, 'console.warn');
          done();
        }
      };
    });

    require('../');
    app.log.replaceConsole();

    app.init(function (err) {
      assert.ifError(err);
      console.warn('console.warn');
    });
  });

  it('can replace console.error', function (done) {
    app.on('log:store', function testStore () {
      return {
        add: function (obj) {
          app.log.restoreConsole();
          assert.equal(obj.level, 'error');
          assert.equal(obj.type, 'console.error');
          done();
        }
      };
    });

    require('../');
    app.log.replaceConsole();

    app.init(function (err) {
      assert.ifError(err);
      console.error('console.error');
    });
  });

  it('can replace console.dir', function (done) {
    app.on('log:store', function testStore () {
      return {
        add: function (obj) {
          app.log.restoreConsole();
          assert.equal(obj.level, 'debug');
          assert.equal(obj.type, 'dump');
          assert.deepEqual(obj.data, {foo: 'bar'});
          done();
        }
      };
    });

    require('../');
    app.log.replaceConsole();

    app.init(function (err) {
      assert.ifError(err);
      console.dir({foo: 'bar'});
    });
  });

  it('can log data mithout modifying it by reference', function (done) {
    app.on('log:store', function testStore () {
      return {
        add: function (obj) {
          app.log.restoreConsole();
          assert.equal(obj.level, 'info');
          assert.equal(obj.type, 'dump');
          assert.equal(obj.data.name, 'Brian');
        }
      };
    });

    require('../');
    app.log.replaceConsole();

    app.init(function (err) {
      assert.ifError(err);
      var data = {
        name: 'Brian',
        type: 'person',
        color: 'blue'
      };
      console.log(data);
      assert.equal(data.type, 'person');
      done();
    });
  });
});<commit_msg>Fix typo in test<commit_after>describe('console', function () {
  var app;

  beforeEach(function (done) {
    app = createTestApp({}, done);
  });

  afterEach(function (done) {
    app.destroy(done);
  });

  it('can replace console.log', function (done) {
    app.on('log:store', function testStore () {
      return {
        add: function (obj) {
          app.log.restoreConsole();
          assert.equal(obj.level, 'info');
          assert.equal(obj.type, 'console.log');
          done();
        }
      };
    });

    require('../');
    app.log.replaceConsole();

    app.init(function (err) {
      assert.ifError(err);
      console.log('console.log');
    });
  });

  it('can replace console.info', function (done) {
    app.on('log:store', function testStore () {
      return {
        add: function (obj) {
          app.log.restoreConsole();
          assert.equal(obj.level, 'info');
          assert.equal(obj.type, 'console.info');
          done();
        }
      };
    });

    require('../');
    app.log.replaceConsole();

    app.init(function (err) {
      assert.ifError(err);
      console.info('console.info');
    });
  });

  it('can replace console.warn', function (done) {
    app.on('log:store', function testStore () {
      return {
        add: function (obj) {
          app.log.restoreConsole();
          assert.equal(obj.level, 'warn');
          assert.equal(obj.type, 'console.warn');
          done();
        }
      };
    });

    require('../');
    app.log.replaceConsole();

    app.init(function (err) {
      assert.ifError(err);
      console.warn('console.warn');
    });
  });

  it('can replace console.error', function (done) {
    app.on('log:store', function testStore () {
      return {
        add: function (obj) {
          app.log.restoreConsole();
          assert.equal(obj.level, 'error');
          assert.equal(obj.type, 'console.error');
          done();
        }
      };
    });

    require('../');
    app.log.replaceConsole();

    app.init(function (err) {
      assert.ifError(err);
      console.error('console.error');
    });
  });

  it('can replace console.dir', function (done) {
    app.on('log:store', function testStore () {
      return {
        add: function (obj) {
          app.log.restoreConsole();
          assert.equal(obj.level, 'debug');
          assert.equal(obj.type, 'dump');
          assert.deepEqual(obj.data, {foo: 'bar'});
          done();
        }
      };
    });

    require('../');
    app.log.replaceConsole();

    app.init(function (err) {
      assert.ifError(err);
      console.dir({foo: 'bar'});
    });
  });

  it('can log data without modifying it by reference', function (done) {
    app.on('log:store', function testStore () {
      return {
        add: function (obj) {
          app.log.restoreConsole();
          assert.equal(obj.level, 'info');
          assert.equal(obj.type, 'dump');
          assert.equal(obj.data.name, 'Brian');
        }
      };
    });

    require('../');
    app.log.replaceConsole();

    app.init(function (err) {
      assert.ifError(err);
      var data = {
        name: 'Brian',
        type: 'person',
        color: 'blue'
      };
      console.log(data);
      assert.equal(data.type, 'person');
      done();
    });
  });
});
{'fraction_non_alphanumeric': 0.18338629142078983, 'fraction_numerical': 0.0, 'mean_word_length': 1.9774774774774775, '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': '6669716', 'n_tokens_mistral': 2067, 'n_tokens_neox': 2018, 'n_words': 357}