<commit_before>const test = require('ava')
const helpers = require('./_helpers')

test('throw error if plugin gets registered twice', (t) => {
  t.throws(() => helpers.registerPlugin(helpers.getServer()), Error)
})

test('throw error if own options are invalid – colored', (t) => {
  t.throws(() => helpers.getServer({
    colored: null
  }), Error)

  t.throws(() => helpers.getServer({
    colored: 42
  }), Error)

  t.throws(() => helpers.getServer({
    colored: ''
  }), Error)

  t.throws(() => helpers.getServer({
    colored: 'foobar'
  }), Error)

  t.throws(() => helpers.getServer({
    colored: NaN
  }), Error)

  t.throws(() => helpers.getServer({
    colored: {}
  }), Error)

  t.throws(() => helpers.getServer({
    colored: []
  }), Error)

  t.throws(() => helpers.getServer({
    colored: new RegExp()
  }), Error)
})

test('throw error if own options are invalid – indent', (t) => {
  t.throws(() => helpers.getServer({
    indent: null
  }), Error)

  t.throws(() => helpers.getServer({
    indent: false
  }), Error)

  t.throws(() => helpers.getServer({
    indent: NaN
  }), Error)

  t.throws(() => helpers.getServer({
    indent: {}
  }), Error)

  t.throws(() => helpers.getServer({
    indent: []
  }), Error)

  t.throws(() => helpers.getServer({
    indent: new RegExp()
  }), Error)
})

test('throws no error if own options are valid – colored', (t) => {
  t.notThrows(() => helpers.getServer({
    colored: true
  }), Error)
})
<commit_msg>add test for override option<commit_after>const test = require('ava')
const helpers = require('./_helpers')

test('throw error if plugin gets registered twice', (t) => {
  t.throws(() => helpers.registerPlugin(helpers.getServer()), Error)
})

test('throw error if own options are invalid – colored', (t) => {
  t.throws(() => helpers.getServer({
    colored: null
  }), Error)

  t.throws(() => helpers.getServer({
    colored: 42
  }), Error)

  t.throws(() => helpers.getServer({
    colored: ''
  }), Error)

  t.throws(() => helpers.getServer({
    colored: 'foobar'
  }), Error)

  t.throws(() => helpers.getServer({
    colored: NaN
  }), Error)

  t.throws(() => helpers.getServer({
    colored: {}
  }), Error)

  t.throws(() => helpers.getServer({
    colored: []
  }), Error)

  t.throws(() => helpers.getServer({
    colored: new RegExp()
  }), Error)
})

test('throw error if own options are invalid – override', (t) => {
  t.throws(() => helpers.getServer({
    override: null
  }), Error)

  t.throws(() => helpers.getServer({
    override: 42
  }), Error)

  t.throws(() => helpers.getServer({
    override: ''
  }), Error)

  t.throws(() => helpers.getServer({
    override: 'foobar'
  }), Error)

  t.throws(() => helpers.getServer({
    override: NaN
  }), Error)

  t.throws(() => helpers.getServer({
    override: {}
  }), Error)

  t.throws(() => helpers.getServer({
    override: []
  }), Error)

  t.throws(() => helpers.getServer({
    override: new RegExp()
  }), Error)
})

test('throw error if own options are invalid – indent', (t) => {
  t.throws(() => helpers.getServer({
    indent: null
  }), Error)

  t.throws(() => helpers.getServer({
    indent: false
  }), Error)

  t.throws(() => helpers.getServer({
    indent: NaN
  }), Error)

  t.throws(() => helpers.getServer({
    indent: {}
  }), Error)

  t.throws(() => helpers.getServer({
    indent: []
  }), Error)

  t.throws(() => helpers.getServer({
    indent: new RegExp()
  }), Error)
})

test('throws no error if own options are valid – colored', (t) => {
  t.notThrows(() => helpers.getServer({
    colored: true
  }), Error)
})

test('throws no error if own options are valid – override', (t) => {
  t.notThrows(() => helpers.getServer({
    override: true
  }), Error)
})

{'fraction_non_alphanumeric': 0.20422346966051858, 'fraction_numerical': 0.0016038492381716118, 'mean_word_length': 3.2474460839954595, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 54, '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': '5786338', 'n_tokens_mistral': 1278, 'n_tokens_neox': 1236, 'n_words': 308}