<commit_before>var AssertionError = require('assert').AssertionError;
var expect = require('chai').expect;
var clierr = require('../..'),
  load = clierr.load,
  definition = clierr.ErrorDefinition,
  errors = clierr.errors;

describe('cli-error:', function() {
  beforeEach(function(done) {
    clierr.clear();
    done();
  });
  afterEach(function(done) {
    clierr.clear();
    done();
  });
  it('should throw assertion error on warn()', function(done) {
    function fn() {
      clierr.warn({});
    }
    expect(fn).throws(AssertionError);
    done();
  });
})<commit_msg>Assert on warning message.<commit_after>var AssertionError = require('assert').AssertionError;
var expect = require('chai').expect;
var clierr = require('../..'),
  define = clierr.define;

describe('cli-error:', function() {
  beforeEach(function(done) {
    clierr.clear();
    done();
  });
  afterEach(function(done) {
    clierr.clear();
    done();
  });
  it('should throw assertion error on warn()', function(done) {
    function fn() {
      clierr.warn({});
    }
    expect(fn).throws(AssertionError);
    done();
  });
  it('should print message on warn()', function(done) {
    var key = 'EARGLENGTH';
    var message = 'too few arguments';
    var def = define(key, message);
    clierr.warn(def);
    done();
  });
})
{'fraction_non_alphanumeric': 0.18354912414318356, 'fraction_numerical': 0.0, 'mean_word_length': 3.578397212543554, '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': '3578063', 'n_tokens_mistral': 436, 'n_tokens_neox': 425, 'n_words': 89}