<commit_before><commit_msg>tests for lib/error.js<commit_after>/*eslint-env node, mocha*/
/*eslint max-nested-callbacks: ["error", 4]*/
/*eslint-disable  no-magic-numbers*/

const demand = require('must')
const Error  = require('../../lib/error.js')


describe('lib/error.js', function() {


  it('You should be able to throw a NotFound error',
  function() {

    try {

      Error.throwCussError(Error.NotFound, 'foo', 'bar')

    } catch (e) {

      demand(e.message).eql(`Not Found - TABLE: foo ID: bar`)
      demand(e.status).eql(404)

    }

  })


})
{'fraction_non_alphanumeric': 0.18571428571428572, 'fraction_numerical': 0.007142857142857143, 'mean_word_length': 3.1555555555555554, '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': '2310835', 'n_tokens_mistral': 208, 'n_tokens_neox': 191, 'n_words': 42}